Help with conversions (suite) - Mailing list pgsql-sql

From Stéphane DEWITTE
Subject Help with conversions (suite)
Date
Msg-id NOEAIPGJHJIHECKNEIBGKEHGCOAA.stephane@smeso.fr
Whole thread Raw
List pgsql-sql
Hello everybody.

I have a little problem.

Where I make a
select to_number('123456.789','000000.00') or select
to_number('123456.789','000000D00')
I obtain 123456.78

When I try to make that in a function, I have a varchar in ligne.temp8 (ex:
'123456.78910')
temp_dr_cli_cod := to_number(ligne.temp8,''000000000'');

That is good (without decimals of course), but when I try to add a dot or a
'D' in the format field (ex : temp_dr_cli_cod :=
to_number(ligne.temp8,''000000.000'') or temp_dr_cli_cod :=
to_number(ligne.temp8,''000000D000'') I get a error message :
ERROR:  parser: parse error at or near "000000".

Can someone help me ?

Thanks a lot.

Regards,
Stéphane.






pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Need some help with dates
Next
From: Stephan Szabo
Date:
Subject: Re: My is degraded after two weeks