Discussion:
SUBSTR don't work with parametized query under IBQuery component?
(too old to reply)
Source Finder
2007-01-23 14:14:46 UTC
Permalink
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
Jeff Overcash (TeamB)
2007-01-28 06:27:48 UTC
Permalink
Post by Source Finder
' ......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
'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.
Post by Source Finder
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)
Loading...