[sqlite] [FireDAC][Phys][SQLite]-326. Cannot perform the action, because the previous action is in progress.

2019-11-25 Thread Edson Polonio
Hi everyone! 

I am using SQLite, with Delphi XE Rio and Firedac and I don't know why, a
cited error message appeared. 

I've tried everything to unlock the database: I renamed the .db file,
changed the folder file, turned off the notebook, etc.,
but I can't unlock the .db database. 

The error occurs when trying to open the query a second time, for example: 

1) first execution - OK 

qry.active: = False;
qry.SQL.Clear;
qry.SQL.Add ('DELETE FROM TAB_USERS');
qry.ExecSQL; 

2) second execution - ERROR
qry.active: = False;
qry.SQL.Clear;
qry.SQL.Add ('INSERT INTO TAB_USERS ... ... ...');
qry.ExecSQL; 

The error is fired at the line "qry.SQL.Clear;" 

I don't know what else to do ... Does anyone have any tips? 

Thankful! 

 

 

 

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] [FireDAC][Phys][SQLite]-326. Cannot perform the action, because the previous action is in progress.

2019-11-25 Thread Edson
Hi everyone! 

I am using SQLite, with Delphi XE Rio and Firedac and I don't know why, a
cited error message appeared. 

I've tried everything to unlock the database: I renamed the .db file,
changed the folder file, turned off the notebook, etc.,
but I can't unlock the .db database. 

The error occurs when trying to open the query a second time, for example: 

1) first execution - OK 

qry.active: = False;
qry.SQL.Clear;
qry.SQL.Add ('DELETE FROM TAB_USERS');
qry.ExecSQL; 

2) second execution - ERROR
qry.active: = False;
qry.SQL.Clear;
qry.SQL.Add ('INSERT INTO TAB_USERS ... ... ...');
qry.ExecSQL; 

The error is fired at the line "qry.SQL.Clear;" 

I don't know what else to do ... Does anyone have any tips? 

Thankful! 

 

 

 

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread Edson Poderoso
Using the chinook database available at:
https://github.com/lerocha/chinook-database

The following query should return 26 rows, instead I returns 15.


WITH GbC AS ( SELECT c.Country, c.CustomerId, SUM(i.total) spent
FROM Customer c
JOIN Invoice i
ON i.CustomerId = c.CustomerId
GROUP BY 1, 2),
MbC AS ( SELECT Country, MAX(spent) spent
FROM GbC GROUP BY 1)
SELECT outerr.*
FROM GbC outerr
WHERE outerr.spent =
(SELECT spent
FROM MbC WHERE Country = outerr.Country)
ORDER BY 1, 3 DESC


-- 

Edson Poderoso
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users