Subject RE: [firebird-support] decimal separator
Author Sasha Matijasic
> Hi !
> I generate some inserts with my Delphi app. I'm experimenting some
> problems if
> the PC which is running the program has , (comma) as decimal separator.
>
> Having a field "amount" numeric (18,3) an a value of $100.23
> My insert would be like:
>
> INSERT INTO MYTABLE (amount) VALUES 100,23
>

Try this:
Insert into mytable (ammount) values (100.23);

You need to use a dot, not a comma. And you need parens.

> I'd like to know is the common practice to deal with it. I could
> reeplace the
> "," for a "." in my app. But is that the *correct* way to do it?
>

The correct way is to use parameters like this (pseudo delphi code)

ammount := 100.23;
dataset.sql := 'insert into mytable (ammount) values (:ammoutn)';
dataset.parambyname('ammount').asfloat := ammount;
dataset.execquery;

exact syntax depends on your components, but this should give you an idea to go on.

Sasha