Subject | Re: [firebird-support] Use of params in where clause on 'BLOB SUB_TYPE 1' fields? |
---|---|
Author | Helen Borrie |
Post date | 2006-02-08T09:51:27Z |
At 08:20 PM 8/02/2006, you wrote:
shouldn't be a problem if AString has been defined as a text
blob. I'm guessing that you're used to Delphi syntax from somewhere
and are trying to use it in a DSQL tool that doesn't know about
Delphi, such as isql...
select
ID
from
ART_OMS
where
DESCRIPTION = ?
When the engine tries to prepare it, it has no idea what "?" is so
you get an exception.
But, if you pass a string parameter by some means, you'll have a type
mismatch, anyway. If the parameter is a string, it's not a
blob; and, if it were a blob, it wouldn't work, either, because blob
= blob comparison can't be done without a UDF.
You could pass a string parameter to this statement (properly
prepared) because both of those expressions implicitly take string arguments:
select
ID
from
ART_OMS
where
DESCRIPTION STARTING WITH ?
or
select
ID
from
ART_OMS
where
DESCRIPTION CONTAINING ?
comparison purposes (or vice versa, not quite sure which way around
it is!) The constant is recognisably a string, and the engine knows
what to do.
./heLen
>Hi,In what environment are you using the first syntax? Stored procedure
>
>Ik get 'internal error' on executing the following query below.
>DESCRIPTION is a 'BLOB SUB_TYPE 1' field. Is this syntax supported?
shouldn't be a problem if AString has been defined as a text
blob. I'm guessing that you're used to Delphi syntax from somewhere
and are trying to use it in a DSQL tool that doesn't know about
Delphi, such as isql...
>When i use constants instead of params the query works.FYI, the actual syntax that passes through the API is
>
>select
> ID
>from
> ART_OMS
>where
> DESCRIPTION = :AString
select
ID
from
ART_OMS
where
DESCRIPTION = ?
When the engine tries to prepare it, it has no idea what "?" is so
you get an exception.
But, if you pass a string parameter by some means, you'll have a type
mismatch, anyway. If the parameter is a string, it's not a
blob; and, if it were a blob, it wouldn't work, either, because blob
= blob comparison can't be done without a UDF.
You could pass a string parameter to this statement (properly
prepared) because both of those expressions implicitly take string arguments:
select
ID
from
ART_OMS
where
DESCRIPTION STARTING WITH ?
or
select
ID
from
ART_OMS
where
DESCRIPTION CONTAINING ?
>This works.That's because the constant value is being converted to a blob for
>
>select
> ID
>from
> ART_OMS
>where
> DESCRIPTION = 'blablabla'
comparison purposes (or vice versa, not quite sure which way around
it is!) The constant is recognisably a string, and the engine knows
what to do.
./heLen