Re: SQL returns diff results in ESQL and Power Builder
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration
Yes we are initialising the var to 0.
The count(*) in the ESQL/C program returns one though there is no record in
the table. I tried modifying the sql as :
insert into newtab
select * from d65_po_itm
where some_conditions_here
After running the above query, if I query the newtab table, there are no
records in newtab, and that is how it should be.
Table newtab has the same structure as d65_po_itm
Vinod Bhansali
>From: Carlos Benjamin <benj@linuxstart.com>
>To: iiug@hotmail.com, informix-list@iiug.org
>Subject: Re: SQL returns diff results in ESQL and Power Builder
>Date: Fri, 2 Jun 2000 05:56:18 -0700
>
>Vinod Bhansali <iiug@hotmail.com> wrote:
>
> >Hi guys,
> >
> >We have a SQL like below in an ESQL/C program
> >select count(*) in :var
> >from ...... where ....>
>Well, sure. You have an uneven number of dots in your from and where
>clauses....
>
>Actually, are you initializing var to zero?
>
> >When we execute it from ESQL/C it returns 1 in var
> >When we execute it from Power Builder or Dbaccess it returns 0 in var
> >
> >We are sure that the result from Power Builder and Dbaccess is right.
> >
> >Does any body know why sql from ESQL/C gives wrong results
> >
> >Thanks in advance
> >Vinod Bhansali
> >Informix DBA
> >DSL Transportation
> >________________________________________________________________________
> >Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
> >
>
>
>carlos
>
>Currently on hiatus from unemployment.
>----------------------
>Do you do Linux? :)
>Get your FREE @linuxstart.com email address at: http://www.linuxstart.com
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
Vinod, could you post the relevant parts of your ESQL/C program? Also, if you execute your ESQL/C statement for some other table (e.g. systables) does it return the correct number of rows? Also, I should note that there are no bugs open (or ever entered) that resemble you problem (doesn't say that it couldn't be a new one: which version are you using?). Hope this helps, Heiko