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 

SUBSTR don't work with parametized query under IBQuery compo

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





PostPosted: Tue Jan 23, 2007 8:14 pm    Post subject: SUBSTR don't work with parametized query under IBQuery compo Reply with quote



Hi, i try to use the follow code:

' ......SUBSTR(:par, 4, 2) .......' when SUBSTR is one external function
defined on interbase but i get the follow error message when i try run this
SQL on IBQUERY component:
'Data Type unknow'. I define the "par" parameter correctly (string) on the
Parameter editor but the error persist.
The SUBSTR function work correctly in all cases, but in this case don't.
I solve this problem sending parameter formated from my application (using
Copy function), but i ask ..... Where are the error?
Why the code SUBSTR(:par, 4, 2) don't work?

Thank's
Back to top
Jeff Overcash (TeamB)
Guest





PostPosted: Sun Jan 28, 2007 9:10 am    Post subject: Re: SUBSTR don't work with parametized query under IBQuery c Reply with quote



Source Finder wrote:
Quote:
Hi, i try to use the follow code:

' ......SUBSTR(:par, 4, 2) .......' when SUBSTR is one external function
defined on interbase but i get the follow error message when i try run this
SQL on IBQUERY component:
'Data Type unknow'. I define the "par" parameter correctly (string) on the
Parameter editor but the error persist.
The SUBSTR function work correctly in all cases, but in this case don't.
I solve this problem sending parameter formated from my application (using
Copy function), but i ask ..... Where are the error?
Why the code SUBSTR(:par, 4, 2) don't work?


A lot of times this is because you have parameters in both the select portion
and the where portion of the SQL statement. InterBase parses this in a manner
that would require a different left to right top to bottom parse that TParam
has. The InterBase team has been made aware of this and that they should change
it to match other SQL engines, but to date they haven't. Try having parameters
in only one or the other section, not both.


Quote:
Thank's




--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
A human being should be able to change a diaper, plan an invasion, butcher
a hog, conn a ship, design a building, write a sonnet, balance accounts, build
a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act
alone, solve equations, analyze a new problem, pitch manure, program a computer,
cook a tasty meal, fight efficiently, die gallantly. Specialization is for
insects. (RAH)
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.