dynamic sql with Pro*C/WinNT 4.0
From: nothing <nothing_at_cc.gatech.edu>
Date: 1997/04/11
Message-ID: <5im4as$ies_at_smash.gatech.edu>#1/1
}
Date: 1997/04/11
Message-ID: <5im4as$ies_at_smash.gatech.edu>#1/1
[Quoted] I'm trying to get some dynamic sql working under Pro*C 2.1.2.0.3 in WinNT 4.0 -- I'm trying to build a dynamic cursor based on user input from a web page. If anyone can help with this snippet of code, I would be very grateful. According to the book I have, this is all I need to build the cursor and retrieve rows... and of course it doesn't work.
void aFunction()
{
EXEC SQL BEGIN DECLARE SECTION;
char query[101];
EXEC SQL END DECLARE SECTION;
SQLDA *descr;
/* database routines to connect... already tested and working */
/* string input gets placed in query */
EXEC SQL PREPARE S1 FROM :query; EXEC SQL DECLARE C1 CURSOR FOR S1; EXEC SQL OPEN C1 USING DESCRIPTOR descr; EXEC SQL DESCRIBE SELECT LIST FOR S1 INTO descr; EXEC SQL FETCH C1 USING DESCRIPTOR descr; EXEC SQL CLOSE C1;
}
-- | "human junk just words and so much skin nothing_at_cc.gatech.edu | stick my hands thru the cage of this endless routine | just some flesh caught in this big broken machine" | -nin, "happiness in slavery"Received on Fri Apr 11 1997 - 00:00:00 CEST