Formal parameters as host variables
From: Nathan Banks <banks_at_neptune.iex.com>
Date: Wed, 3 Nov 1993 20:53:13 GMT
Message-ID: <1993Nov3.205313.9485_at_iex.uucp>
--
Date: Wed, 3 Nov 1993 20:53:13 GMT
Message-ID: <1993Nov3.205313.9485_at_iex.uucp>
How do you specify to a SQL preprocessor such as ProC that the formal parameters of a C function are to be used as host variables in ensuing embedded SQL statements?
I usually fetch information into local host variables, then copy these into the call-by-reference formal parameters. Is there any easier way?
int fetchData(int *formal_data, SQLCODE *sqlcode) {
EXEC SQL BEGIN DECLARE SECTION;
int *hv_data;
EXEC SQL END DECLARE SECTION;
hv_data = formal_data;
EXEC SQL FETCH cursor1 into :hv_data; /* Cursor previosly defined */
*sqlcode = sqlca.sqlcode;
return (sqlca.sqlcode != 0);
}
Nathan
--
/| |\ Nathan Banks / | | \ IEX Corporation Voice: 214.301.1206 \ | | / 2425 North Central Expressway, Suite 350 Fax: 214.301.1200 \| |/ Richardson, Texas 75080 Email: banks_at_iex.com
--
/| |\ Nathan Banks / | | \ IEX Corporation Voice: 214.301.1206 \ | | / 2425 North Central Expressway, Suite 350 Fax: 214.301.1200 \| |/ Richardson, Texas 75080 Email: banks_at_iex.comReceived on Wed Nov 03 1993 - 21:53:13 CET