views:

268

answers:

2

Am extending the data layer of an existing application to work with FireBird 2.5, in addition to MSSQL and SQLite, but have hit a stumbling block.

I have a field called TimeStamp which stores the data/time as type TimeStamp. This works fine under MSSQL and SQLite where the type is datetime, but falls over under Firebird. The following SQL:

[CODE]SELECT SysTrnId,'TimeStamp' from "TRANSACTIONS"[/CODE]

seemingly works, but the TimeStamp field is return as fieldname "CONSTANT" and the contents are the text "timestamp"

Is it possible to do this under FireBird, or am I going to have to rename the field and change the code in the other data layers.

Thanks

Colin

A: 

I have no idea if it works, but have you tried double quotes around "TimeStamp", single quotes usually indicate a constant string.

Regards
K

Khb
Yes, I tried that but got the error:Dynamic SQL Error SQL error code = -206 Column unknown timestamp At line 1, column 29 Colin
CDM
+1  A: 

The firebird escape character is the double quote ". Note that in firebird if you have a field that you have to escape with double quotes, it also becomes case sensitive. So, if you've declared your field as TimeStamp, then select "TIMESTAMP" ... will fail with a field not found error.

Donnie
Thanks, that did it. I realise that the field name will need to be changed, but need to fix this first, before I can dive in and make it so throughout the different databases supported. Thanks.
CDM