Subject | Re: Use of params in where clause on 'BLOB SUB_TYPE 1' fields? |
---|---|
Author | flipmooooo |
Post date | 2006-02-08T11:51:24Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...>
wrote:
IBExpert and it won't work there either. We are using delphi with FIB
datacomponents. But basically if i understood you correctly you can't
pass a (string) parameter for a 'BLOB SUB_TYPE 1' field when
using '=,<,>' operators in the where clause right ?
Greetings,
Filip Moons
with AQuery do
begin
Transaction.StartTransaction;
try
ParamByName('ADESCRIPTION').AsString := Edit1.Text;
ExecQuery;
finally
if Open then
Close;
Transaction.Commit;
end;
end;
wrote:
>procedure
> At 08:20 PM 8/02/2006, you wrote:
> >Hi,
> >
> >Ik get 'internal error' on executing the following query below.
> >DESCRIPTION is a 'BLOB SUB_TYPE 1' field. Is this syntax supported?
>
> In what environment are you using the first syntax? Stored
> shouldn't be a problem if AString has been defined as a textsomewhere
> blob. I'm guessing that you're used to Delphi syntax from
> and are trying to use it in a DSQL tool that doesn't know abouttype
> Delphi, such as isql...
>
> >When i use constants instead of params the query works.
> >
> >select
> > ID
> >from
> > ART_OMS
> >where
> > DESCRIPTION = :AString
>
> FYI, the actual syntax that passes through the API is
>
> 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
> mismatch, anyway. If the parameter is a string, it's not ablob
> blob; and, if it were a blob, it wouldn't work, either, because
> = blob comparison can't be done without a UDF.arguments:
>
> You could pass a string parameter to this statement (properly
> prepared) because both of those expressions implicitly take string
>knows
> select
> ID
> from
> ART_OMS
> where
> DESCRIPTION STARTING WITH ?
>
> or
>
> select
> ID
> from
> ART_OMS
> where
> DESCRIPTION CONTAINING ?
>
>
> >This works.
> >
> >select
> > ID
> >from
> > ART_OMS
> >where
> > DESCRIPTION = 'blablabla'
>
> That's because the constant value is being converted to a blob for
> comparison purposes (or vice versa, not quite sure which way around
> it is!) The constant is recognisably a string, and the engine
> what to do.In the application we are building. I tried the same query in
>
> ./heLen
>
> In what environment are you using the first syntax?
IBExpert and it won't work there either. We are using delphi with FIB
datacomponents. But basically if i understood you correctly you can't
pass a (string) parameter for a 'BLOB SUB_TYPE 1' field when
using '=,<,>' operators in the where clause right ?
Greetings,
Filip Moons
with AQuery do
begin
Transaction.StartTransaction;
try
ParamByName('ADESCRIPTION').AsString := Edit1.Text;
ExecQuery;
finally
if Open then
Close;
Transaction.Commit;
end;
end;