Ok, then it must be the statement.+1
I find INTERVAL(0:0:0) a really strange SQL-term (but I'm not familiar with DB Informix).
If FPC is trying to parse that, it could stumble too.
You could try setting ParseSQL to false.
FormDB.DBquery.ParseSQL := false; FormDB.DBquery.Open;
What is left to be implemented:(http://wiki.freepascal.org/ODBCConn)
proper transaction support; currently each connection corresponds to one transaction some field types
SQL_TYPE_UTC* (these are mentioned in the ODBC docs, but seem not to be used in implementations)
SQL_INTERVAL_* (what would be the corresponding TFieldType?)
SQL_GUID (TGUIDField was not implemented, until recently)
My understanding is that dtDateTime interpretation correlates with century and can't simultaneously hold 2018-03-14 12:00:00 and 2 00:00:00 (different centures)It can. One will be 2018-03-14 12:00:00 and the other will be 1900-01-01 00:00:00 (usually 1890-12-30 00:00:00 is date "zero").
Well, it seems that there is no other way to deal with INTERVAL but to write my implementation for it, that is not a good idea for beginner.You could also request a change in the bug-tracker (feature request). (not sure if it's already in there)
Or either switch my project development to Delphi... :(Doesn't Delphi interpret INTERVAL as just a TStringField?
Doesn't Delphi interpret INTERVAL as just a TStringField?
In that case you're just as well off using a CAST to string in your queries.
If so, how it can be possible to INSERT value of type INTERVAL into TABLE?In Delphi the string should be converted back to INTERVAL by the database.
Oracle recognizes literals for other ANSI interval types and converts the values to Oracle interval values.(I guess it would be the same for DB Informix ODBC)
If so, how it can be possible to INSERT value of type INTERVAL into TABLE?In Delphi the string should be converted back to INTERVAL by the database.
Then why this is not working in Lazarus?
This command I expected to work:But I have to write:
FormDB.DBquery.SQL.text:='select TODAY::DATETIME YEAR TO SECOND + callend UNITS SECOND from callrecord;';
FormDB.DBquery.SQL.text:='select TO_CHAR(TODAY::DATETIME YEAR TO SECOND + callend UNITS SECOND, ''%T'') from callrecord;';
Because that's not an INSERT statement and we were talking about insert automatically converting string to INTERVAL. At least that's what you asked.Then why this is not working in Lazarus?If so, how it can be possible to INSERT value of type INTERVAL into TABLE?In Delphi the string should be converted back to INTERVAL by the database.
This command I expected to work:But I have to write:
FormDB.DBquery.SQL.text:='select TODAY::DATETIME YEAR TO SECOND + callend UNITS SECOND from callrecord;';
FormDB.DBquery.SQL.text:='select TO_CHAR(TODAY::DATETIME YEAR TO SECOND + callend UNITS SECOND, ''%T'') from callrecord;';