Re: Pro*C - nice coding techniques

From: Hans Plambeck <hans_at_iris.mincom.oz.au>
Date: 5 Feb 92 21:15:00 GMT
Message-ID: <1553_at_iris.mincom.oz.au>


/* Just to give an idea as I worked around it, pcc is not too clever you know.  */

EXEC SQL BEGIN DECLARE SECTION;
#ifdef never_true

static char A_VALUE[20];
#endif

EXEC SQL END DECLARE SECTION;
EXEC SQL INCLUDE sqlca;

#define A_VALUE s->this_value

void my_option ( s )
struct stuff {

       char this_value[20];
} *s;
{
EXEC SQL SELECT avalue into :A_VALUE from atable;

/* which results internally into
 sq003.sq003V[0] = (unsigned char *)A_VALUE;

 For pointers to strings, Oracle would use strlen() to determine the length,

     so you don't have to have numbers.
 */
}--
Hans-J Plambeck Mincom Pty Ltd hans_at_mincom.oz.au +61 (7) 364 9999 Received on Wed Feb 05 1992 - 22:15:00 CET

Original text of this message