Gilles Ganault <[EMAIL PROTECTED]> writes:

> 
> Hello
> 
> I have a list of books in an SQLite database. I'd like to rewrite the
> Price column so that:
> 1. When it says "US$ 1.12", turn this into "$ 1.12"
> 2. When it says nothing, the currency is actually in Euros, and
> rewrite this as "€10,19".
> 
> Can SQLite do this, or should I write a script to perform this
> rewriting?
> 
> Thank you.

Looks like a programming problem rather than a database issue.

Before your application inserts the data into the db, scan it for
a currency symbol (or just $ in your case).
[or your original db field could be 'Raw Amount' and you process it
into the new format - could even be a TRIGGER on the INSERT !]

You can then maintain a field "Currency" and another field "Amount".

When outputting values (or producing a report) reformat according to currency.
E.g. 
if Currency == dollar, separator = '.' ... if Currency == euro, separator =  ','
(could also be done in the TRIGGER above too, with another field)

etc. !

Regards,
MikeW

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to