Re: Why the #$%^ won't this Pro*C command work?!?!
Date: 1996/02/22
Message-ID: <4ghq8f$m73_at_maverick.tad.eds.com>#1/1
stollj_at_ncr.disa.mil wrote:
[snip]
> EXEC SQL EXECUTE..BEGIN..END;..END-EXEC; (with some simple SQL such as SELECT 1 INTO :tmp_num FROM dual; between the BEGIN & END; - where I
>define tmp_num as an integer before the EXEC SQL EXECUTE block), I get an 'Invalid SQL statement' error message. WHAT'S GOING ON?? WHAT AM I
Just a guess, since you don't give enough to be sure... Did you define 'tmp_num' as an Oracle host variable ?
example for Windows 3.1 client running with SQL*NET v1.1 or 2.0
/* Oracle - required for standalone compile */ #define SQLCA_STORAGE_CLASS extern
EXEC SQL
INCLUDE SQLCA;
ADML_LLIST * __export adml_list_users( char *(*pmalloc)(),
void (*pfree)(), char *pgm_nm, long *nbr_records )
{
char fcn_nm[] = "adml_list_users",
[stuff deleted]
EXEC SQL
BEGIN DECLARE SECTION; varchar userinfo_user_busns_unit_abrvt[6];
[stuff deleted]
EXEC SQL
END DECLARE SECTION;
EXEC SQL
DECLARE ADMIN_CUR CURSOR FOR SELECT USER_BUSNS_UNIT_ABRVT FROM GMTMTLL1.USERINFO WHERE USER_ADMIN_IND IN ('S','A');
[stuff deleted]
EXEC SQL
OPEN ADMIN_CUR;
[stuff deleted]
EXEC SQL
FETCH ADMIN_CUR INTO :userinfo_user_busns_unit_abrvt;
-- Hugh Stewart McKenna lnusebs.jzbnvs_at_eds.com -- "There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group - there is less competition" -- Indira GhandiReceived on Thu Feb 22 1996 - 00:00:00 CET