SQL Connection sample programs
The Connectivity Series distribution includes sample programs that illustrate the basic structure for an SQL Connection program. (See Writing an SQL Connection program.) These programs are in the connect\synsqlx subdirectory of the main Synergy/DE installation directory.
On OpenVMS, when linking SQL Connection programs, be sure to use the ssqlrtl.opt link options file (instead of synrtl.opt). |
Examples that work with MySQL, Oracle, and SQL Server, and Synergy databases
These are distributed on all platforms.
- exam_create_table.dbl. Creates a table and inserts some rows of data. Run this program first. Note that if you uncomment the “.define MULTI_ROW_INSERT” line, this program performs a bulk insert.
- exam_fetch.dbl. Contains a simple query. Retrieves rows inserted by exam_create_table.dbl.
- exam_multirow_fetch.dbl. Contains a multi-row query. Retrieves rows inserted by exam_create_table.dbl.
- exam_fetch_update.dbl. Contains a simple update. Retrieves rows inserted by exam_create_table.dbl (by using a bind variable in the WHERE clause) and then updates the data using %SSC_SQLLINK. Uses a cached cursor to update additional data by calling %SSC_REBIND with a different value for the bind variable.
Example for MySQL
This example for MySQL is distributed only on Windows and Unix.
- stp_mysql.dbl. Calls a stored procedure to access the table created by exam_create_table.dbl.
Example for Oracle
This example for Oracle is distributed on all platforms.
- stp_ora.dbl. Calls a stored procedure to access the table created by exam_create_table.dbl.
Examples for SQL Server
These examples for SQL Server are distributed only on Windows and will run only if the Microsoft pubs sample database is installed. (This legacy sample database is no longer installed with SQL Server by default. See the comments in the files for details.)
- stp_odbc.dbl, stp_sqlsrv1.dbl, stp_sqlsrv2.dbl. Call stored procedures to access the table created by exam_create_table.dbl.
Other examples
The Connectivity Series distribution (all platforms) includes exam_saveviews.dbl, an example program for saving views for xfODBC.