SQL select and C [message #94254] |
Thu, 10 June 2004 02:26 |
Jordi Sole
Messages: 1 Registered: June 2004
|
Junior Member |
|
|
I've found this way to execute a select in a C program
{
struct sqlexd sqlstm;
sqlstm.sqlvsn = 8;
sqlstm.arrsiz = 1;
sqlstm.stmt = "select count(distinct CODI_PLA) into :b0 from PSN_CONFIG_PL
A ";
sqlstm.iters = (unsigned int )1;
sqlstm.offset = (unsigned int )2;
sqlstm.selerr = (unsigned short)1;
sqlstm.cud = sqlcud0;
sqlstm.sqlest = (unsigned char *)&sqlca;
sqlstm.sqlety = (unsigned short)0;
sqlstm.sqhstv[[0]] = (unsigned char *)&lNumPlans_CgCfg;
sqlstm.sqhstl[[0]] = (unsigned int )4;
sqlstm.sqindv[[0]] = ( short *)0;
sqlstm.sqharm[[0]] = (unsigned int )0;
sqlstm.sqphsv = sqlstm.sqhstv;
sqlstm.sqphsl = sqlstm.sqhstl;
sqlstm.sqpind = sqlstm.sqindv;
sqlstm.sqparm = sqlstm.sqharm;
sqlstm.sqparc = sqlstm.sqharc;
sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);
}
Anyone could explain me the syntax? or a place where i could find some help or some user's guide?
Thank you, Jordi
|
|
|
Re: SQL select and C [message #94263 is a reply to message #94254] |
Wed, 23 June 2004 06:20 |
Frank Naude
Messages: 4589 Registered: April 1998
|
Senior Member |
|
|
Hi,
I don't even want to start explaining the syntax to you. But if you really want to know, you can study the "Oracle Call Interface Programmer's Guide".
Luckily the Pro*C precomplier can generate these statements from high-level source. This is documented in the "Pro*C/C++ Precompiler Programmer's Guide".
Best regards.
Frank
|
|
|
|