I am using regina 3.4 on WinXP.
I have a situation where I need to issue the same set of queries to the sqlite command-line program (Sqlite3) a number of times. I want to write a rexx script to automate this. It sounds simple but I can't get it! I tried something like -
inp.0 = 2
inp.1 = 'sqlite3 test.db'
inp.2 = 'select * from table1;'
address system with input stem inp.1 output stream 'out.txt'
It doesn't work. Any tips ?
>address system with input stem inp.1 output stream 'out.txt'
Doesn't the target of 'stem' have to be an actual stem variable?
i.e. address system with input stem inp. output stream 'out.txt'
sorry about the typo. I had used a stem variable "inp." in my code, and not "inp.1". still doesn't work.
What goes in the Input stem is the commands you would normally type into the sqlite program.
So your program should be:
inp.0 = 1
inp.1 = 'select * from table1;'
address system 'sqlite3 test.db' with input stem inp. output stream 'out.txt'
If you are doing lots of sqlite commands, I'd suggest you use Rexx/SQL; it provides native interface into sqlite3, and saves you running the sqlite3 client each time.
Thanks a lot. It's working fine.
One thing is that "address system" does not accept the full pathname of the program - I had to put the sqlite program in the current directory.
(I am using the sqlite client just to check the updates made by another program...so i wanted a macro to avoid tedious typing.)
Used directory function to get around the issue..Rgds
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.