BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

A query that works directly and within IDE but NOT when the

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (InterBase Express)
View previous topic :: View next topic  
Author Message
Franz Fortuny
Guest





PostPosted: Tue May 15, 2007 9:33 pm    Post subject: A query that works directly and within IDE but NOT when the Reply with quote



This query:

select a.id,a.descri,a.existe-a.reser as dispo,
a.existe,a.reser,a.pventa,a.pventa2,
a.area,a.serial,a.idarea,a.cosba
from vwsubexi a where descri like :modelo and
(idarea=:idarea or idarea is null)
union all
select b.id,b.descri,b.existe-b.reser as dispo,
b.existe,b.reser,b.pventa,b.pventa2,
b.area,b.serial,b.idarea,b.cosba
from subartis su
join tor_equiv te on te.idsub1=su.idsubarti and su.descri like :modelo
join vwsubexi b on b.id=te.idsub2 and b.existe > 0

will produce correct results when executed directly (via ibexpert) or
when tested within the IDE.

But when the query is executed with the running program, it generates
the following result:

Dynamic SQL Error
SQL error code = -804
Incorrect values within SQLDA structure.

Why does this happen? It definitely has to do with either the way the
running program is sending the query or the way it is receiving it.

I suspect it has to do with receiving it rather than sending it, because
the Prepare() instruction does run correctly during runtime.

I must add that my workaround was to hide the offending query within a
PROCEDURE and execute the procedure from the program. Then the results
were what I needed. However, I don't see why this sort of thing has to
happen...

Any light upon this darkness will be greatly appreciated.

F J Fortu
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (InterBase Express) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.