-
I'd like to write a table analyzer function in QtScript. It receives a table name as parameter and runs a number of analysis queries against the table. Then it creates a new table and stores all analysis results there. For that I need to connect from inside the QtScript function to the database and run some SQL queries. The table analyzer would be invoked from an editor window.
The code is ready as a stand-alone Perl script and can be run from a shell against the SQLite database file. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
This is how far I got:
https://github.com/pawelsalawa/sqlitestudio/wiki/ScriptingQt says I should not run CREATE or INSERT queries inside the function. Is there a clever way to present more results for all fields in the table (instead of four results from a single field)? |
Beta Was this translation helpful? Give feedback.
-
To be honest I don't remember why I made such a comment on manual page for ScriptingQt. For the ScriptingTcl it is slightly different - it says not to execute I think you should be fine using CREATE and INSERT, as long as you don't modify the very table you are SELECTing from at the moment. I mean for example this below - as something forbidden. The scalar function named
The SQL query:
Please avoid such operations! Recursion does not work efficiently with scalar functions! |
Beta Was this translation helpful? Give feedback.
-
That sounds promising. Thanks a lot. |
Beta Was this translation helpful? Give feedback.
This is how far I got:
https://github.com/pawelsalawa…