Recent

Author Topic: SQL query to ODBC fails from my application, while fine from ODBC query tool  (Read 6506 times)

rvk

  • Hero Member
  • *****
  • Posts: 6110
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:
Code: XML  [Select][+][-]
  1. FormDB.DBquery.SQL.text:='select TODAY::DATETIME YEAR TO SECOND + callend UNITS SECOND from callrecord;';
But I have to write:
Code: Pascal  [Select][+][-]
  1. FormDB.DBquery.SQL.text:='select TO_CHAR(TODAY::DATETIME YEAR TO SECOND + callend UNITS SECOND, ''%T'') from callrecord;';
  2.  
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.

 

TinyPortal © 2005-2018