Parameters in update doesn't work

The offical for ZeosLib 7.3 Report problems, ask for help, post proposals for the new version of Zeoslib 7.3/v8
Quick Info:
-We made two new drivers: odbc(raw and unicode version) and oledb
-GUID domain/field-defined support for FB
-extended error infos of Firebird
-performance ups are still in queue
In future some more feature will arrive, so stay tuned and don't hassitate to help
Post Reply
piotr.b.brzeski
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: 20.07.2020, 07:01

Parameters in update doesn't work

Post by piotr.b.brzeski »

Hi,

I have written a project that moves data from one ORACLE database to another. One of the main functions of this project is to transfer the printouts that are in the database in the BLOB column. For a long time, everything worked flawlessly, but after migrating to the latest version of Lazarus, the content of the printouts is reported via TSQL.Params is empty. Below is the code that worked fine until upgraded to the newer version. What's wrong now? As if the parameters stop working?

Code: Select all

  
                                   // wpompowanie wzorca itp z buff
                                   begin
             		             MenuGlowne.ZQueryTEST.ParamCheck:= true;

             		             ImportWdwz.ImpWdwzBufDataSet.CreateDataset;
             		             ImportWdwz.ImpWdwzBufDataSet.Edit;
             		             ImportWdwz.ImpWdwzBufDataSet.FieldByName('wydrWDWZ').AsVariant:= wydrWDWZ;
             		             ImportWdwz.ImpWdwzBufDataSet.Post;

             		             MenuGlowne.ZQueryTEST.SQL.Text:= 'begin update wdwz set wydr = :WYDRWDWZ, opis = :OPISWDWZ, opsz = :OPSZWDWZ where id = '+seqWDWZ+'; end;'+#0;
                                     aktualnySQL:= MenuGlowne.ZQueryTEST.SQL.Text;
             		             MenuGlowne.ZQueryTEST.Params[0].LoadFromStream(ImportWdwz.ImpWdwzBufDataSet.CreateBlobStream(ImportWdwz.ImpWdwzBufDataSet.FieldByName('wydrWDWZ'), bmRead), ftBlob);
             		             MenuGlowne.ZQueryTEST.Params.ParamByName('OPISWDWZ').Value:= opisWDWZ;
             		             MenuGlowne.ZQueryTEST.Params.ParamByName('OPSZWDWZ').Value:= opszWDWZ;
             		             MenuGlowne.ZQueryTEST.ExecSQL;

             		             ImportWdwz.ImpWdwzBufDataSet.Active:= false;

             		             MenuGlowne.ZQueryTEST.ParamCheck:= false;
                                   end;
 
changes are obviously committed correctly

(I have ZEOS 8.0.0 beta, but in 7.2.14 problem is the same)
piotr.b.brzeski
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: 20.07.2020, 07:01

Re: Parameters in update doesn't work

Post by piotr.b.brzeski »

To be clear, in all steps the parameter has the content, but after the update is completed and the database is entered from other applications (even SQLDeveloper, etc.), it turns out that the content of the BLOB column is empty.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Parameters in update doesn't work

Post by marsupilami »

Hello piotr,

some questions:
  • Did the FPC version change between tests? Are you sure that the only thing that changed is Lazarus?
  • Are you sure, this isn't a problem on the TBufDataset side?
  • Could you please try to provide a complete test case? Like an short sql script that generates necessary tables and date and a small program that demonstrates the problem?
Best regards,

Jan
piotr.b.brzeski
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: 20.07.2020, 07:01

Re: Parameters in update doesn't work

Post by piotr.b.brzeski »

Did the FPC version change between tests?
Yes.
Are you sure that the only thing that changed is Lazarus?
Yes. Lazarus and version of ZEOS.
Are you sure, this isn't a problem on the TBufDataset side?
Yes.

----

I checked on the database side - parameters in v$parameters for these SQL are empty. I am talking of course about the ORACLE database
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Parameters in update doesn't work

Post by marsupilami »

Hello Piotr,

could you please try to create a small example program and SQL create table script that demonstrates the problem? This will help greatly in tracking things down.

Best regards,

Jan
piotr.b.brzeski
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: 20.07.2020, 07:01

Re: Parameters in update doesn't work

Post by piotr.b.brzeski »

Hello,
create table test_blob(
blob_column blob
);

insert into test_blob(blob_column) values(EMPTY_BLOB());
a sample program in the appendix.
You do not have the required permissions to view the files attached to this post.
Post Reply