-1

Ok i am going thru documentation i got to a point where the collation is the subject

Imagine this : in USA you have 30[color=#FF0000].[/color]00$ in BRAZIL you have 30[color=#FF0000],[/color]00 R$

-how can i solve this !! so that the database won't interpret it wrong ?

Vertica documentation [quote]Notes • Even though ICU locales can normally specify collation, currency, and calendar preferences, Vertica supports only the collation component. The SET DATESTYLE TO ... command provides some aspects of the calendar; [color=#FF0000]only dollars are supported for currency[/color]. Any keywords not relating to collation are rejected. [/quote]

Up_One
  • 5,213
  • 3
  • 33
  • 65
  • Solution to this problem is :LC_ALL=pt_BR.UTF-8 Start Vertica. On vsql: dbadmin=> SELECT TO_CHAR(12343148.567890123, 'L999G999G999G999D999999'); TO_CHAR --------------------------- R$ 12.343.148,567890 – Up_One Sep 19 '12 at 20:05

1 Answers1

0

The way I've implemented currency storage is to store the amount in a field and the currency type in another field.

If you're looking to just change the Currency Symbol in the results, check out Template patterns for Numeric Formatting page 271 in 6.0 SQL Reference Manual.pdf.

That is the only location in the doc that I found 'currency'.

QuinnG
  • 6,346
  • 2
  • 39
  • 47
  • I don't think i understand !! can you post an example on numeric formatting regarding my issue ?!
    – Up_One Sep 03 '12 at 12:33
  • @UP_TWO My Answer has the wrong page number, it's 270. There are examples in the doc on how to use the formatting. – QuinnG Sep 03 '12 at 13:18
  • Ok i get it but still , even if i change the local to my local(pt_BR)i still get the DOT "." and not comma"," as it should be in pt_BR.
    See in US currency is 12.23 cents in BR should be 12,23!!!!!!!
    – Up_One Sep 03 '12 at 14:39
  • @UP_TWO Can you provide the template pattern you used? – QuinnG Sep 03 '12 at 14:47
  • select to_number('12.23','L999D99'); – Up_One Sep 03 '12 at 16:42
  • select to_number('12,23','L999D99'); - i am having comma as input – Up_One Sep 03 '12 at 16:43
  • @UP_TWO: Since you are using the `D` in the template and still getting template, I'd suggest hitting up the Vertica forums and seeing what you get from there. Sorry I can't be more exact, haven't had to do locales – QuinnG Sep 04 '12 at 03:45
  • LC_ALL=pt_BR.UTF-8 Start Vertica. On vsql: dbadmin=> SELECT TO_CHAR(12343148.567890123, 'L999G999G999G999D999999'); TO_CHAR --------------------------- R$ 12.343.148,567890 – Up_One Sep 19 '12 at 20:06