Coders' Corner Search:
General :: Programming :: Delphi :: Database
Database development with Delphi. Includes issues with BDE, ADO and InterBase.

Articles:


Featured Article

Today's date on database server

This is another case where ORACLE and InterBase SQL dialects are different.

In ORACLE, it is SYSDATE,
in InterBase, it is TODAY.

// make the SQL dependent on type of DBMS
 
 if AppLibrary.Database.DriverName = 'ORACLE' then
   SQL.Add ('and entry_date < SYSDATE')
 else
   SQL.Add ('and entry_date < "TODAY"');
 end;
 
 // SQL to query the date in ORACLE
 select to_char(sysdate, 'DD-Mon-YYYY HH24:MI:SS') as "Current Time" from MyTable;