ESQL/C question
Posted in 2010
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
We are trying to write some dynamic processes and they seem to work for SELECT, INSERT but for UPDATE and DELETE we are not getting the descriptors.
We are compiling with IBM Informix CSDK Version 2.81 on AIX 4.3.3 and hitting a database on AIX 5.3 and IDS 11.50.FC6.
Query is
update dkc_flags set phone_number = ?, etor_status = ?, bcast_mesg_status = ?, bcast_mesg_expire = ? where location_code = ?
We issue the following statements:
EXEC SQL prepare demo4id from :demoquery;
printf("step 1\\n");
EXEC SQL allocate descriptor 'demo4desc_in' with max 50;
printf("step 2\\n");
EXEC SQL describe demo4id using sql descriptor 'demo4desc_in';
printf("step 3 get COUNT value\\n");
EXEC SQL get descriptor 'demo4desc_in' :desc_coutn_in = COUNT ;
For the update statement above we get a count of 0 instead of what we would expect of 5, one for each "?".
Am I missing something here?
Thanks for any help...
David Link
On Apr 16, 11:34 am, "Link, David A" <DAL...@west.com> wrote:
> We are trying to write some dynamic processes and they seem to work for SELECT, INSERT but for UPDATE and DELETE we are not getting the descriptors.
>
> We are compiling with IBM Informix CSDK Version 2.81 on AIX 4.3.3 and hitting a database on AIX 5.3 and IDS 11.50.FC6.
>
> Query is
> update dkc_flags set phone_number = ?, etor_status = ?, bcast_mesg_status = ?, bcast_mesg_expire = ? where location_code = ?>
> We issue the following statements:
>
> EXEC SQL prepare demo4id from :demoquery;
>
> printf("step 1\\n");
> EXEC SQL allocate descriptor 'demo4desc_in' with max 50;
>
> printf("step 2\\n");
> EXEC SQL describe demo4id using sql descriptor 'demo4desc_in';
>
> printf("step 3 get COUNT value\\n");
> EXEC SQL get descriptor 'demo4desc_in' :desc_coutn_in = COUNT ;
>
> For the update statement above we get a count of 0 instead of what we would expect of 5, one for each "?".
>
> Am I missing something here?
>
> Thanks for any help...
>
> David Link
When I took your code and modified it slightly I think it works.
Instead of using just the EXEC SQL describe, it appears you need to
use
EXEC SQL describe input demo4id using sql descriptor 'demo4desc_in';
That got my count to return 5.
The other thing I tried was setting the env variable IFX_UPDDESC and
just use EXEC SQL describe (no input). However, when I did that, the
count that I got returned was 1 less then I expected.
Can check the IDS guide to SQL:Syntax for info about the describe and
describe input (and also describe output).
I'm not sure why IFX_UPDDESC count and describe input counts don't
match however (I'm more en engines guy and a tools guy)
Hope this helps some.
Jacques Renaut
IBM Informix Advanced Support
APD Team
Thank, Jacques. I believe that solved my problem.
Thanks again.
-----Original Message-----
From: informix-list-bounces@iiug.org [mailto:informix-list-bounces@iiug.org] On Behalf Of jrenaut
Sent: Friday, April 16, 2010 2:22 PM
To: informix-list@iiug.org
Subject: Re: ESQL/C question
On Apr 16, 11:34 am, "Link, David A" <DAL...@west.com> wrote:
> We are trying to write some dynamic processes and they seem to work for SELECT, INSERT but for UPDATE and DELETE we are not getting the descriptors.
>
> We are compiling with IBM Informix CSDK Version 2.81 on AIX 4.3.3 and hitting a database on AIX 5.3 and IDS 11.50.FC6.
>
> Query is
> update dkc_flags set phone_number = ?, etor_status = ?, bcast_mesg_status = ?, bcast_mesg_expire = ? where location_code = ?>
> We issue the following statements:
>
> EXEC SQL prepare demo4id from :demoquery;
>
> printf("step 1\\n");
> EXEC SQL allocate descriptor 'demo4desc_in' with max 50;
>
> printf("step 2\\n");
> EXEC SQL describe demo4id using sql descriptor 'demo4desc_in';
>
> printf("step 3 get COUNT value\\n");
> EXEC SQL get descriptor 'demo4desc_in' :desc_coutn_in = COUNT ;
>
> For the update statement above we get a count of 0 instead of what we would expect of 5, one for each "?".
>
> Am I missing something here?
>
> Thanks for any help...
>
> David Link
When I took your code and modified it slightly I think it works.
Instead of using just the EXEC SQL describe, it appears you need to
use
EXEC SQL describe input demo4id using sql descriptor 'demo4desc_in';
That got my count to return 5.
The other thing I tried was setting the env variable IFX_UPDDESC and
just use EXEC SQL describe (no input). However, when I did that, the
count that I got returned was 1 less then I expected.
Can check the IDS guide to SQL:Syntax for info about the describe and
describe input (and also describe output).
I'm not sure why IFX_UPDDESC count and describe input counts don't
match however (I'm more en engines guy and a tools guy)
Hope this helps some.
Jacques Renaut
IBM Informix Advanced Support
APD Team
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list