> Is there any way to do something along the lines of PRAGMA
> some_command(SELECT * FROM table1 JOIN table2) and have it return A, B, C,
> a, b, c as the headers?

If you really want to do it with "table_info", you could create a
temporary view with the "select":

----------------------------------------------------
SQLite version 3.6.17
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table t1 ( A, B, C );
sqlite> create table t2 ( a, b, c );
sqlite> create temp view v1 as select * from t1 join t2;
sqlite> .mode col
sqlite> .h 1
sqlite> insert into t1 values ( 1, 2, 3 );
sqlite> insert into t1 values ( 2, 3, 4 );
sqlite> insert into t2 values ( 3, 4, 5 );
sqlite> insert into t2 values ( 4, 5, 6 );
sqlite> select * from v1;
A           B           C           a:1         b:1         c:1
----------  ----------  ----------  ----------  ----------  ----------
1           2           3           3           4           5
1           2           3           4           5           6
2           3           4           3           4           5
2           3           4           4           5           6
sqlite> pragma table_info(v1);
cid         name        type        notnull     dflt_value  pk
----------  ----------  ----------  ----------  ----------  ----------
0           A                       0                       0
1           B                       0                       0
2           C                       0                       0
3           a:1                     0                       0
4           b:1                     0                       0
5           c:1                     0                       0
----------------------------------------------------

But I'm not sure if it's exactly the same as if from a select.


Regards,
~Nuno Lucas
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to