Then
I created table database with tables 'sales' (common table with only
data) and 'v_sales' - pivot table from 'pivot_vtab' extension - code is here:
create virtual table v_sales using pivot_vtab (
(select distinct product from sales),
(select distinct year, year from sales),
(select sum(income) from sales where product = ?1 and year = ?2)
);
The
creating procedure was OK. But when im trying to execute table 'v_sales'
('select * from v_sales;'), following error occures:
* Exception class $C0000005 with message 'c0000005 ACCESS_VIOLATION'. Process Project1.exe (7996)
*
Exception class EAccessViolation with message 'Access violation at
address 00007FF97B88F1E3 in module 'sqlite3.dll'. Read of address
FFFFFFFFFFFFFFFF'. Process Project1.exe (7996)
When executing table 'v_sales' from sqlite3.exe (not in Delphi), works correctly.
My code in Delphi is following:
UniConnection.SpecificOptions.Values['EnableLoadExtension'] := 'True';
UniConnection.ExecSQL('SELECT load_extension(''pivot_vtab.dll'');');
UniQuery.sql.Text := 'select * from v_sales;';
UniQuery.ExecSQL; // here occures an error!!!
No idea where can be the problem ... thank you in advance for answers.