If you wish to use SQLite (as opposed to a DB2 manager running on some mainframe) to test the example script, then first, you need to obtain the SQLite Database manager. Go to the SQLite web site and select the download link at the top right. (The example script was tested with version sqlite-3_0_8.zip). Install the SQLite Database manager in the normal manner. The installation produces only one file, SQLite3.exe.
Next, download the SQLite ODBC code at www.ch-werner.de/sqliteodbc.
(If this ever moves, google sqlite odbc, and you should find it again). This will download a file named sqliteodbc.exe which installs ODBC support for SQLite's database manager. Run this program, and it will automatically copy the needed DLL’s to your system directory.
Once you have SQLite installed, you should test that installation before writing/testing any REXX scripts that use it.
- Open a Command Prompt window, and change the directory to the directory where SQLite has been installed (ie, the directory were SQLite3.exe was created).
- Type the following command and press ENTER:
SQLite3 test.db
Note: Specifying test.db is important. Without it, none of your tables will ever be saved.
- Type the following SQLite commands at the prompt, pressing ENTER after each one:
Create table tbl1(one varchar(10), two smallint);
insert into tbl1 values('hello!',10);
insert into tbl1 values('goodbye', 20);
select * from tbl1;
- Type the following SQLite command, and then press ENTER, to terminate SQLite3.exe:
.exit
- You may close the command prompt window now.