Re: pro*c question not running sql
Date: 24 Jan 2006 09:32:10 -0800
Message-ID: <1138123930.944400.253890_at_z14g2000cwz.googlegroups.com>
sac wrote:
> EXEC SQL INCLUDE SQLCA;
> #include "stdio.h"
> void main (void)
> {
> EXEC SQL BEGIN DECLARE SECTION;
> char * uid ="SCOTT/TIGER";
> int x=0;
> EXEC SQL END DECLARE SECTION;
>
> EXEC SQL CONNECT :uid;
> printf("Connected as ....%s",uid);
> EXEC SQL select sal into :x from emp where empno=7369;
> printf("..%d",x):
> }
>
>
> it compiles fine and makes the exe...no errors...
>
> it shows the output as "Connected as ....SCOTT/TIGER..0"
Just because you printed that message does not mean the connect
succeeded.
Does your full program have error checking? Verify the connection works
befor any thing else.
> it is i
> think not executing the select statement ,i have tried selecting many
> other things same problem.....could you help please...
And after the connection succeds, what errors code do you see for the
select?
Yes you can check the status from proC. With NO error checking, your
guess is as good as mine.
(hint: ON ERROR goto ...)
HTH,
ed
Received on Tue Jan 24 2006 - 18:32:10 CET