ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Help with SaveToFile with Store procedure

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ali Posted - Nov 16 2023 : 04:20:43
Hi Nigel
In below codes I can export all images of my database to a folder.
but in 15000 records is working good but for heavy database for example 50000 show error :''out of memory'.
I think which for each save picture for each record I most create BF TBlobField and free BF.
Also i use BF.free for this line //BF.Fre show error :'nvalid pointer position'.
my ram is 16 GB and windows 10 64bit.
Please help me.

procedure TMainForm.BitBtn9Click(Sender: TObject);
var BF: TBlobField;
begin
 
while( not(Mainform.ADOQuery_PictureTable.Eof)) do
  begin
    Mainform.spGetCardPicture.Close;
    Mainform.spGetCardPicture.Parameters.ParamByName('@siCard').Value := Mainform.ADOQuery_PictureTable.FieldByName('sicard').AsInteger;
    Mainform.spGetCardPicture.Open;
    If not (Mainform.spGetCardPicture.FieldByName('photo').IsNull)
      then
         begin
          BF := Mainform.spGetCardPicture.FieldByName('photo') as TBlobField;
          BF.SaveToFile('c:\Export'+'\'+Mainform.ADOQuery_PictureTable.FieldByName(Field_name1).AsString+'.jpg');
          //BF.Free;

         Mainform.ADOQuery_PictureTable.Next;
        end
          else
            begin
             Mainform.ADOQuery_PictureTable.Next;
             ProgressBar1.Position:=ProgressBar1.Position+1;
             Label2.Caption :=IntToStr(ProgressBar1.Position)+'/'+IntToStr(Max);
            end;
      end;

end;

Best Regards

Ali Abbasi
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Nov 20 2023 : 22:51:03
Hi Ali

It is closed because you have not provided sufficient debugging information for them (StackOverflow is quite strict). Follow the advice in the blue box at:
https://stackoverflow.com/questions/77500492/delphi-stored-procedure-memory-free


Nigel
Xequte Software
www.imageen.com
ali Posted - Nov 20 2023 : 10:32:17
Hi

I tested Remy Lebeau code and Delphi show error.
Tomorrow I will test and report Delphi error.

unfortunately this link closed.
https://stackoverflow.com/questions/77500492/delphi-stored-procedure-memory-free

Best Regards

Ali Abbasi
xequte Posted - Nov 19 2023 : 18:39:11
Hi Ali

I see that the learned Remy Lebeau has answered you on StackOverflow. Were you able to resolve the issue then?

Nigel
Xequte Software
www.imageen.com
ali Posted - Nov 16 2023 : 23:14:58
Hi Nigel

Thank you very much from your attention.
I cannot create BF and free BF in this section of my code for each times save to file.if my for you pleae help me otherwise I ask in stack over flow website.

If not (Mainform.spGetCardPicture.FieldByName('photo').IsNull)
then
begin
//I cannot creat BF here because show error pointer position.
BF := Mainform.spGetCardPicture.FieldByName('photo') as TBlobField;
BF.SaveToFile('c:\Export'+'\'+Mainform.ADOQuery_PictureTable.FieldByName(Field_name1).AsString+'.jpg');
/I cannot free BF here because show error pointer position.

Mainform.ADOQuery_PictureTable.Next;
end.



Best Regards

Ali Abbasi
xequte Posted - Nov 16 2023 : 13:56:28
Hi Ali

I cannot see any obvious errors in your code.

You should NOT free BF as its just referencing a field in your table.

However this is a forum for ImageEn queries, so you may get better advice from a general site like StackOverflow.


Nigel
Xequte Software
www.imageen.com