Jump to Real's How-to Main page

Get time information from the DBMS

This technique is compatible with any ODBC driver.
  DECLARE dbinfo DYNAMIC CURSOR FOR SQLSA;
  ls_sql = "SELECT {fn curdate() }"
  // ls_sql = "select {fn curtime() }"
  // ls_sql = "SELECT {fn now() }"
  PREPARE SQLSA FROM :ls_sql USING SQLCA;

  OPEN DYNAMIC dbinfo;
  IF SQLCA.SQLCode > 0 THEN
       // erro handling
  END IF
  FETCH  dbinfo INTO :ls_date;
  CLOSE dbinfo;
  RETURN Date(left(ls_date, 10))

If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]