Subject | Re: Use of params in where clause on 'BLOB SUB_TYPE 1' fields? |
---|---|
Author | flipmooooo |
Post date | 2006-02-08T14:46:43Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...>
wrote:
when i use streams the 'internal error' still persists. If the code
below should work normally, maybe its better to take this to FIB
support.
TempStream := TStringStream.Create(Trim(Edit1.Text));
try
with AQuery do
begin
Transaction.StartTransaction;
try
ParamByName('ADESCRIPTION').LoadFromStream(TempStream);
ExecQuery;
finally
if Open then
Close;
Transaction.Commit;
end;
end;
finally
FreeAndNil(TempStream);
end;
Anyway thanks alot for the detailed info you gave me.
Greetings,
Filip Moons
wrote:
>FIB
> At 10:51 PM 8/02/2006, you wrote:
>
> > > In what environment are you using the first syntax?
> >
> >In the application we are building. I tried the same query in
> >IBExpert and it won't work there either. We are using delphi with
> >datacomponents. But basically if i understood you correctly youcan't
> >pass a (string) parameter for a 'BLOB SUB_TYPE 1' field whenparameterise
> >using '=,<,>' operators in the where clause right ?
> >
> >Greetings,
> >Filip Moons
> >
> >
> > with AQuery do
> > begin
> > Transaction.StartTransaction;
> > try
> > ParamByName('ADESCRIPTION').AsString := Edit1.Text;
>
> Edit1.Text isn't a blob, it's a string. If you want to
> a blob, you have to assign a blob to it. I'm sure if you explorethe
> FIB help, you'll find a method that enables this - typically (for aSorry to bother you again with a delphi problem in this forum, but
> text blob) passing the Lines object of a memo component to a stream
> (SaveToStream) and then assigning the stream to your blob parameter.
>
> It's a matter of convenience that the engine (in Fb 1.5 and higher)
> will accept a *literal* string and convert it to a text blob for
> you. A blob is a blob is a blob.
>
> > ExecQuery;
> > finally
> > if Open then
>
> Are you sure?
>
> > Close;
> > Transaction.Commit;
> > end;
> > end;
>
> ./heLen
>
when i use streams the 'internal error' still persists. If the code
below should work normally, maybe its better to take this to FIB
support.
TempStream := TStringStream.Create(Trim(Edit1.Text));
try
with AQuery do
begin
Transaction.StartTransaction;
try
ParamByName('ADESCRIPTION').LoadFromStream(TempStream);
ExecQuery;
finally
if Open then
Close;
Transaction.Commit;
end;
end;
finally
FreeAndNil(TempStream);
end;
> > if Open thenNot good to close the query when its open in a finally clause?
>
> Are you sure?
>
> > Close;
Anyway thanks alot for the detailed info you gave me.
Greetings,
Filip Moons