[SQLite3] Multiple Insert

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Stefan Padlo
Posts: 5
Joined: Wed 23 Mar 2011 23:02

[SQLite3] Multiple Insert

Post by Stefan Padlo » Sun 22 May 2011 22:15

Hi!
I use UniDAC 3.7 + C++ Builder XE + sqlite3

I want to load my multi-query from file. The problem is that some of my queries are commented and after ExecSQL(); nothing happens.
QueryFile:

Code: Select all

INSERT INTO tabela(text) VALUES('a');
--INSERT INTO tabela(text) VALUES('b');
-- Some comments here
/*
bla bla bla
*/
INSERT INTO tabela(text) VALUES('c');
...
C++:

Code: Select all

...
TUniQuery *q = new TUniQuery(NULL);
q->Connection = SomeConnection;
for(int i=0;iCount;i++)
{
	q->SQL->Add( s->Strings[i]); // load each line from file, some are disabled(commented)
}
q->ExecSQL();
delete q;
...
When I delete comments in my file, it's fine, but I don't want to do that...

Help :)

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 23 May 2011 14:08

Hello,

You should use the TUniScript component instead of the TUniQuery one to solve this problem.

...
TUniScript *q = new TUniScript(NULL);
....

We'll consider the possibility to add such functionality to TUniQuery in one of the next versions of the product.

Stefan Padlo
Posts: 5
Joined: Wed 23 Mar 2011 23:02

Post by Stefan Padlo » Mon 23 May 2011 20:18

Thanks for the solution! :)
Btw are there any manuals for UniDAC?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 24 May 2011 07:40

Hello,

You can find the help files for UniDAC in the ..\Devart\UniDAC for XXX\Doc folder or download at http://www.devart.com/unidac/unidacchm.zip

Post Reply