Thiebaud Richard wrote:
> 
> If you connect through ODBC, you can still have differences in the
> SQL dialect which the database engine uses, and your program may need
> to be aware of them.
> 
> For example, I have an application which uses DBI:ODBC to connect either
> to Oracle or to MS Access.   I have code which uses "NOW()" in the SQL
> for MS Access which must use "SYSDATE()" in the SQL for Oracle.
> 
> You can minimize this some, using the ODBC standard functions, if the
> database driver recognizeds them.

Indeed, ODBC provides "SQL Minimum Grammer" and "Scalar Functions" for just
this purpose.  An application can determine which scalar functions a driver
supports by calling SQLGetInfo.  For example, an application can determine
which time and date functions are supported by a driver by calling SQLGetInfo
with an information type of SQL_TIMEDATE_FUNCTIONS.

The scalar function NOW( ) has been available since ODBC 1.0.

ODBC uses escape sequences for scalar functions. The syntax of this escape
sequence is as follows: 

{fn scalar-function}

SELECT * FROM orders WHERE due_date > {fn NOW()}

--
  Simon Oliver
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to