The following examples illustrate what kinds of tasks an Adaptive Server Enterprise client application might carry out:
SQL interpreter – the client application prompts the user for queries, sends these queries to the server as language commands, retrieves the results from the Adaptive Server Enterprise, and displays the results. The Sybase isql utility is such an application; it calls the following Client-Library routines:
ct_command(CS_LANG_CMD) to define a language command and its text
ct_send to send it to the server
ct_results to read the results
ct_res_info and ct_describe to find out column formats
ct_bind and ct_fetch to retrieve rows
See “Language commands”. See also the example application shown in “A simple sample program”.
Data-entry – an application that always runs the same queries. The application uses Adaptive Server Enterprise stored procedures to implement application logic for performing inserts, updates, and menu population. The client program invokes the stored procedures by sending RPC commands. Such an application calls:
ct_command(CS_RPC_CMD) to define an RPC command
ct_param or ct_setparam to define parameter values with which to call the procedure
ct_send to send the command to the server
ct_results, ct_bind, ct_fetch, and so forth, to read the results
See “RPC commands”.
Interactive query-by-example – an application that prompts for queries that can contain markers, indicated by a question mark (?), for values to be supplied at runtime. The application uses dynamic SQL commands to:
Prepare the statement, by sending a ct_dynamic(CS_PREPARE) command and handling the results
Query for parameter formats, by sending a ct_dynamic(CS_DESCRIBE_INPUT) command and handling the results
After prompting for input values, execute the statement by sending a ct_dynamic(CS_EXECUTE) command and handling the results