Xbasic

Portability Functions

IN THIS PAGE

Description

SQL syntaxes vary widely between vendors. Function implementations vary even more so. The set of functions below are deemed "Portability" functions. If these functions are used in a SQL statement parsed by one of the Xbasic SQL objects, the appropriate target function for the selected syntax handler is generated automatically by the object when the query is executed. Any argument re-ordering is done by the syntax handler.

Not all back-end databases support all of these functions. Known incompatibilities are noted. If you use a function that Portable SQL does not recognize, it will pass it through to the back-end database. You will get whatever error the database provides.

Examples

To get the current date as part of a query, you would code something like the following:

SELECT CurrentDate(), ... from ...

Depending on the syntax handler in use by the connection ( part of the connection string ) you would actually be executing:

Database Product
Sample Syntax
Microsoft Access

SELECT date()... from ...

MySQL

SELECT curdate()... from ...

Microsoft SQL Server

SELECT getdate()... from ...

Oracle

SELECT SYSDATE ... from ...

See Also