Re: [sqlite] What is the most flexible way to exact the table name from a SQL statement

2017-10-29 Thread Bart Smissaert
I have a VB6/VBA procedure that takes a SQL and produces the table that was altered by that SQL. I think it works with any SQL, but not sure if is of any help to you. RBS On Sat, Oct 28, 2017 at 1:44 PM, Shane Dev wrote: > Hello, > > Let's say I have a table containing of

Re: [sqlite] What is the most flexible way to exact the table name from a SQL statement

2017-10-29 Thread Gwendal Roué
Apologies: I have to amend again my suggestion. The authorizer has to be attached to a "real" database that already has a definition for the involved tables, if you need to know about insertions, deletions, and updates. Gwendal > Le 29 oct. 2017 à 15:37, Gwendal Roué a

Re: [sqlite] What is the most flexible way to exact the table name from a SQL statement

2017-10-29 Thread Gwendal Roué
I should have added that you can check for inserted/deleted/updated tables by looking for more codes than SQLITE_CREATE_TABLE. The provided sample code only checks for table creation. Gwendal > Le 29 oct. 2017 à 15:28, Gwendal Roué a écrit : > > Yes, there is a

Re: [sqlite] What is the most flexible way to exact the table name from a SQL statement

2017-10-29 Thread Gwendal Roué
Yes, there is a general way. To know if a statement creates a database table, 1. Open a private, in-memory, database connection 2. Register an authorizer with sqlite3_set_authorizer (https://sqlite.org/c3ref/set_authorizer.html ). 3. Compile the

Re: [sqlite] What is the most flexible way to exact the table name from a SQL statement

2017-10-28 Thread Simon Slavin
On 28 Oct 2017, at 1:44pm, Shane Dev wrote: > sqlite> select * from sql; > insert into tab1 select 'example text'; > update tab2 set col2 = 123 where col2 = 1; > delete from tab3 where col1 = 2; > > For the first row, I could build a query using instr and substr

[sqlite] What is the most flexible way to exact the table name from a SQL statement

2017-10-28 Thread Shane Dev
Hello, Let's say I have a table containing of SQL statements, for example sqlite> .schema sql CREATE TABLE sql(statement text); sqlite> select * from sql; insert into tab1 select 'example text'; update tab2 set col2 = 123 where col2 = 1; delete from tab3 where col1 = 2; For the first row, I