Application Development Guide

Embedded SQL Samples With No DB2 APIs


Table 42. Embedded SQL Sample programs with No DB2 APIs
Sample Program Name Program Description
adhoc Demonstrates dynamic SQL and the SQLDA structure to process SQL commands interactively. SQL commands are input by the user, and output corresponding to the SQL command is returned. See Example: ADHOC Program for details.

C: adhoc.sqc

advsql Demonstrates the use of advanced SQL expressions like CASE, CAST, and scalar full selects.

C: advsql.sqc ; COBOL: advsql.sqb

blobfile Demonstrates the manipulation of a Binary Large Object (BLOB), by reading a BLOB value from the sample database and placing it in a file. The contents of this file can be displayed using an external viewer.

C: blobfile.sqc

columns Demonstrates the use of a cursor that is processed using dynamic SQL. This program lists a result set from SYSCAT.COLUMNS under a desired schema name.

C: columns.sqc

cursor Demonstrates the use of a cursor using static SQL. See Example: Cursor Program for details.

C: cursor.sqc ; C++: cursor.sqC ; COBOL: cursor.sqb

delet Demonstrates static SQL to delete items from a database.

C: delet.sqc ; COBOL: delet.sqb

dynamic Demonstrates the use of a cursor using dynamic SQL.

C: dynamic.sqc

joinsql Demonstrates using advanced SQL join expressions.

C: joinsql.sqc ; COBOL: joinsql.sqb

largevol Demonstrates parallel query processing in a partitioned environment, and the use of an NFS file system to automate the merging of the result sets. Only available on AIX. See Example: Extracting Large Volume of Data (largevol.c) for details.

C: largevol.sqc

lobeval Demonstrates the use of LOB locators and defers the evaluation of the actual LOB data. See How the Sample LOBEVAL Program Works for details.

C: lobeval.sqc ; COBOL: lobeval.sqb

lobfile Demonstrates the use of LOB file handles. See How the Sample LOBFILE Program Works for details.

C: lobfile.sqc ; COBOL: lobfile.sqb

lobloc Demonstrates the use of LOB locators. See How the Sample LOBLOC Program Works for details.

C: lobloc.sqc ; COBOL: lobloc.sqb

lobval Demonstrates the use of LOBs.

C: lobval.sqc

openftch Demonstrates fetching, updating, and deleting of rows using static SQL. See How the OPENFTCH Program Works for details.

C: openftch.sqc ; COBOL: openftch.sqb

recursql Demonstrates the use of advanced SQL recursive queries.

C: recursql.sqc

sampudf Demonstrates User-Defined Types (UDTs) and User-Defined Functions (UDFs) implemented to modify table entries. All UDFs declared in this program are sourced UDFs.

C: sampudf.sqc

spclient A client application that calls stored procedures in the spserver shared library.

C: spclient.sqc ; C++: spclient.sqC

spcreate.db2 A CLP script that contains the CREATE PROCEDURE statements to register the stored procedures created by the spserver program.

C/C++: spcreate.db2

spdrop.db2 A CLP script that contains the DROP PROCEDURE statements necessary for deregistering the stored procedures created by the spserver program.

C/C++: spdrop.db2

spserver A server program demonstrating stored procedures. The client program is spclient.

C: spserver.sqc ; C++: spserver.sqC

static Demonstrates static SQL to retrieve information. See Example: Static SQL Program for details.

C: static.sqc ; C++: static.sqC ; COBOL: static.sqb

tabsql Demonstrates the use of advanced SQL table expressions.

C: tabsql.sqc ; COBOL: tabsql.sqb

tbdefine Demonstrates creating and dropping tables.

C: tbdefine.sqc

thdsrver Demonstrates the use of POSIX threads APIs for thread creation and management. The program maintains a pool of contexts. A generate_work function is executed from main, and creates dynamic SQL statements that are executed by worker threads. When a context becomes available, a thread is created and dispatched to do the specified work. The work generated consists of statements to delete entries from either the STAFF or EMPLOYEE tables of the sample database. This program is only available on UNIX platforms.

C: thdsrver.sqc ; C++: thdsrver.sqC

trigsql Demonstrates using advanced SQL triggers and constraints.

C: trigsql.sqc ; COBOL: trigsql.sqb

udfcli Demonstrates calling a user-defined function (UDF) created by the udfsrv program, and stored on the server to access tables in the sample database.

C: udfcli.sqc ; C++: udfcli.sqC

updat Demonstrates static SQL to update a database. See Example: UPDAT Program for details.

C: updat.sqc ; C++: updat.sqC ; COBOL: updat.sqb

varinp Demonstrates variable input to Embedded Dynamic SQL statement calls using parameter markers. See How the VARINP Program Works for details.

C: varinp.sqc ; COBOL: varinp.sqb


[ Top of Page | Previous Page | Next Page ]