Thanks Kees for your response. 

I tried embedding the ".read" command into my sql script files and it appears 
to work fine. 



One thing I don't like is having to specify the full path (relative to where 
I'm invoking SQLite3 from) to each file I reference in the scripts I invoke 
with ".read". 

Is there a way to set a temp variable in a script file that I can use to 
specify a file path? 

Then I could use that temp var in the file path. 



Thanks 

Chris 


----- Original Message ----- 
From: "Kees Nuyt" <k.n...@zonnet.nl> 
To: sqlite-users@sqlite.org 
Sent: Thursday, July 15, 2010 11:29:48 AM 
Subject: Re: [sqlite] How to invoke successive SQLite script files 

On Thu, 15 Jul 2010 17:54:38 +0000 (UTC), c...@comcast.net 
wrote: 

> 
> 
> 
>I have a file which contains SQLite and SQLite/SQL commands. 
> 
>I can invoke that file and successfully execute all 
>of the commands in that file by starting a SQLite cmd 
>line session and using the ".read" command. 
> 
>I'll refer to that as script-C. 
> 
> 
>What I would like to do is create a higher level command file (script-A) 
>which not only contains SQLite and SQLite/SQL commands , but will also 
>invoke script-C; and script-B, and other yet-to-be created scripts 
>(in the future). 
> 
>My question is, what command do I use in script-A to 
>invoke script-C, script-B, etc? 

Invoke script-A this way: 

sqlite3 yourdbfile <script-A >outputfile 

and in script-A, use 

: 
.read script-C 
: 
.read script-B 
: 

You can even change the output file on the fly with: 
.output FILENAME 

and back to the redirection with: 
.output stdout 

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

Reply via email to