Summary
The following sample programs demonstrate features of Client-Library
and can be used as models for your own programs.
Contents
This document contains the following sections:
Open Client and Open Server
Program Disclaimer
The Open Client and Open Server applications contained in
this download are intended to provide help and ideas for working
with Sybase connectivity libraries.
Please read this disclaimer before using the code:
THIS CODE IS BEING DISTRIBUTED FREE OF CHARGE. IT IS NOT A
SYBASE PRODUCT, IS NOT SUPPORTED BY SYBASE AND IS PROVIDED “AS-IS” WITHOUT WARRANTY
OF ANY KIND. SYBASE DISCLAIMS ALL WARRANTIES OR CONDITIONS, EITHER
EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES
OF MERCHANTABILITY, MERCHANTABLE QUALITY, NONINFRINGEMENT AND FITNESS
FOR A PARTICULAR PURPOSE (WHETHER ARISING BY STATUTE OR IN LAW OR
AS A RESULT OF A COURSE OF DEALING OR USAGE OF TRADE). IN NO EVENT
SHALL SYBASE BE LIABLE FOR LOSS OF PROFITS OR LOSS OF DATA OR ANY DAMAGES
WHATSOEVER INCLUDING WITHOUT LIMITATION DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL
OR SPECIAL DAMAGES, EVEN IF SYBASE HAS BEEN ADVISED OF THE POSSIBILITY
OF SUCH DAMAGES.
Download the Samples
The download contains all the program, header, and datafiles,
as well as a sample makefile for Unix platforms. Create a directory
for the samples and associated files, and download the compressed
file for your platform:
Expand the download using the WinZip or tar utility.
List of Programs
The following general information applies to the sample programs
listed below:
-
A program may
require the pubs2 database.
-
A program may have an associated README file and an isql script
file; check table below.
-
Unless otherwise stated in the program description
or the program’s README file, all programs can be executed
by simply typing the name of the executable.
This
table contains a list of all the Client-Library programs in this
download and a brief description of what each program does. A Unix
makefile and a header file for these programs are included in the
download:
| Program name
|
Description
|
Other files
|
| t-handlers.c
|
Error handling code for these sample
programs. Contains the error callback routines.
|
|
| array_bind.c
|
Uses Bulk-Library to copy in multiple
rows at a time. This method has been proven to improve
performance.
|
array_bind.sql
|
| bulkcopy.c
|
Uses Bulk-Library calls to insert rows
into a table one at a time.
|
bulkcopy.sql
|
| cursor_sel.c
|
Uses client side cursors to retrieve data
from a table. Also shows how to use input parameters with cursors.
|
|
| cursor_upd.c
|
An enhancement of the previous program.
This program retrieves rows and updates them one at a time.
|
cursor_upd.sql
|
| cursor_proc.c
|
Uses cursors to execute a stored procedure
with parameters.
|
cursor_proc.sql
|
| debug_sample.c
|
Shows how to make calls to ct_debug and
set various flags for debugging. You have to modify the
makefile to link in the required devlibs.
|
|
| diag_example.c
|
Illustrates the use of inline error handling
using ct_diag.
|
|
| dynamic_cur.c
|
Uses Dynamic SQL with cursors to retrieve
data with varying input values.
|
|
| dynamic_ins.c
|
Uses Dynamic SQL to accept input values
for an insert multiple times.
|
dynamic_ins.sql
|
| params.c
|
Shows how to use ct_command with variable
substitution using ct_param.
|
|
| rpc.c
|
Uses RPC calls to execute a stored procedure
with input and output parameters.
|
rpc.sql
|
| time_out.c
|
Shows how to handle timeout situations.
|
time_out.readme
|
| timeout_handler.c
|
Contains standard error handling routines
as well as specific code to handle timeout errors.
|
|
| mult_text.c
|
Updates multiple text columns in a
table.
|
mult_text.sql
|
| locales.c
|
Uses the CS_LOCALE structure
to specify a date format to use for data retrieval.
|
|
| example.h
|
Required header file for these sample
programs.
|
|
| makefile
|
Unix makefile for these sample programs.
|
|