Re: Pro*C (Method 4)

From: walter briscoe <walter_at_wbriscoe.demon.co.uk>
Date: 1996/09/21
Message-ID: <843346461snz_at_wbriscoe.demon.co.uk>#1/1


In article <521o3u$33t_at_hil-news-svc-3.compuserve.com>

           kwright1_at_vossnet.co.uk "Kevin Wright" writes:

> Anybody know anything about writing method 4 programs with a simple
> example included. The Oracle manuals make it look hideous and their
> examples aren't much help either.

It is hideous but it tends to be all embracing so there can be good code reuse. I wrote something which was a cross between sscanf and strtok to allow processing of queries with fixed sets of columns but arbitrary number of rows. The lack of CURSOR variables means that only a single query can be running at a time. The first call passes the statement and a set of pointers to output data, declares the cursor, prepares the statement, binds the variables and fetches the first row. Subsequent calls are done with a null statement and pointers to output data and are mapped on to a fetch. This routine which I call sqlscanf together with another which I call sqlprintf allow one to avoid EXEC SQL in most of one's C code. sqlprintf maps onto a method one call. In principle, sqlscanf deals with queries which can be handled by method 3 calls but who needs the aggravation of manually coding such stuff.

--
Walter Briscoe
Received on Sat Sep 21 1996 - 00:00:00 CEST

Original text of this message