Page 1 of 1

[SQLite3] Multiple Insert

Posted: Sun 22 May 2011 22:15
by Stefan Padlo
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 :)

Posted: Mon 23 May 2011 14:08
by AlexP
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.

Posted: Mon 23 May 2011 20:18
by Stefan Padlo
Thanks for the solution! :)
Btw are there any manuals for UniDAC?

Posted: Tue 24 May 2011 07:40
by AlexP
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