On Sat, 14 Mar 2009 03:45:43 -0700 (PDT), Derek Developer
<derekdevelo...@yahoo.com> wrote:

>To make it really easy, I have created three .sql files and an application 
>that is NOT command line akward. There are three .sql files with the 
>statements needed to create two databases and execute the outer join.
>Drag and drop them onto the application to execute them...
>http://www.transferbigfiles.com/Get.aspx?id=ebd730fd-17ad-45c9-a341-43d078b118e3

That works as a charm with the original command line tool,
that is to say, I don't get the error you mentioned before,
"Error = UNKNOWN TABLE db2.TableTwo"

Differences between your and my environment:

- I didn't use your application, the sqlite3.exe from
sqlite.org is not behaving "command line awkward" to me.

- To obtain full output I added .echo on to the .sql
scripts, no changes otherwise. 

I hope this helps.

Versions
--------
Microsoft Windows [Version 6.0.6001] (=Vista)
SQLite version 3.6.11

Shell script
------------
sqlite3.exe Db1.sql3 <Db1.sql
sqlite3.exe Db2.sql3 <Db2.sql
sqlite3.exe Db1.sql3 <Db1.LeftOuterjoin.sql


Output
------
# \data\bin\sqlite3\sqlite3.exe Db1.sql3  0<Db1.sql
BEGIN TRANSACTION;
create table episodes ( id integer primary key, season int,
name text );
INSERT INTO "episodes" VALUES(0, NULL, 'Good News Bad
News');
INSERT INTO "episodes" VALUES(1, 1, 'Male Unbonding');
INSERT INTO "episodes" VALUES(2, 1, 'The Stake Out');
INSERT INTO "episodes" VALUES(3, 1, 'The Robbery');
INSERT INTO "episodes" VALUES(4, 1, 'The Stock Tip');
INSERT INTO "episodes" VALUES(5, 2, 'The Ex-Girlfriend');
INSERT INTO "episodes" VALUES(6, 2, 'The Pony Remark');
INSERT INTO "episodes" VALUES(7, 2, 'The Busboy');
INSERT INTO "episodes" VALUES(8, 2, 'The Baby Shower');
INSERT INTO "episodes" VALUES(9, 2, 'The Jacket');
INSERT INTO "episodes" VALUES(10, 2, 'The Chinese
Restaurant');
INSERT INTO "episodes" VALUES(11, 2, 'The Phone Message');
INSERT INTO "episodes" VALUES(12, 2, 'The Apartment');
INSERT INTO "episodes" VALUES(13, 2, 'The Stranded');
INSERT INTO "episodes" VALUES(14, 2, 'The Statue');
COMMIT;
Select * from episodes;
0||Good News Bad News
1|1|Male Unbonding
2|1|The Stake Out
3|1|The Robbery
4|1|The Stock Tip
5|2|The Ex-Girlfriend
6|2|The Pony Remark
7|2|The Busboy
8|2|The Baby Shower
9|2|The Jacket
10|2|The Chinese Restaurant
11|2|The Phone Message
12|2|The Apartment
13|2|The Stranded
14|2|The Statue

# \data\bin\sqlite3\sqlite3.exe Db2.sql3  0<Db2.sql
create table foods( id integer primary key, type_id integer,
name text );
INSERT INTO "foods" VALUES(1, 1, 'Bagels');
INSERT INTO "foods" VALUES(2, 1, 'Bagels, raisin');
INSERT INTO "foods" VALUES(4, 1, 'Bear Claws');
INSERT INTO "foods" VALUES(8, 1, 'Carrot Cake');
INSERT INTO "foods" VALUES(13, 1, 'Cinnamon Bobka');
Select * from foods;
1|1|Bagels
2|1|Bagels, raisin
4|1|Bear Claws
8|1|Carrot Cake
13|1|Cinnamon Bobka

# \data\bin\sqlite3\sqlite3.exe Db1.sql3
0<Db1.LeftOuterjoin.sql
ATTACH 'Db2.sql3' AS Db2;
SELECT d.id, d.season, d.name, n.name
 FROM episodes d LEFT
 OUTER JOIN Db2.foods n ON n.id=d.id
 WHERE d.id > 2
 ORDER BY d.season;
3|1|The Robbery|
4|1|The Stock Tip|Bear Claws
5|2|The Ex-Girlfriend|
6|2|The Pony Remark|
7|2|The Busboy|
8|2|The Baby Shower|Carrot Cake
9|2|The Jacket|
10|2|The Chinese Restaurant|
11|2|The Phone Message|
12|2|The Apartment|
13|2|The Stranded|Cinnamon Bobka
14|2|The Statue|

#

-- 
  (  Kees Nuyt
  )
c[_]
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to