Building a server independent script

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
PixAndMore
Posts: 11
Joined: Mon 16 Aug 2010 04:13
Location: Holzwickede

Building a server independent script

Post by PixAndMore » Sat 04 Sep 2010 13:20

Hi there,
i want to store 500 records at one time. Normally I would use:
for i := 1 to 500 do begin
qry1.params[0].value := 'This is a \ String \ yes!'
qry1.execute;
end;

Now I had made test with TUniScript:
for i := 1 to 500 do
s := s + 'insert into .... ;';
script.sql.text := s;
script.execute;

Thats fine, it runs over 15 times faster!

Now the problem: In the first example I can use Parameters and the data values are not a problem, the parameter is always correct for every database....

But in the script I have escape the data values for every supported database. The data in the first example contains a backslash, that must be converted while using MySQL as server, for Firebird not...

Do you have a "UniDAC" solution for me? I think TUniDump can handle this during export, but I want create new records...

Regards, Kai

AndreyZ

Post by AndreyZ » Mon 06 Sep 2010 10:59

Hello,

You can use the TUniLoader component which serves for fast loading of data to the server.
You can look at the example of using it in UniDacDemo.

Post Reply