Re: passing database through ARG_VAL?
Posted in 1998
On Tue, 8 Dec 1998, Daniel Farr wrote: > I'm brand new to i4gl and the newsgroup. Check out the FAQ at the IIUG web site (http://www.iiug.org). > I work in a data-conversion shop and the utilities I am trying to build > with i4gl need to have the DATABASE variable passed to them through ARG_VAL. > (i.e., there are many databases to choose from, and input was in a previous > shell script). > > So far, I have had very limited success. Why? No code, so we can't tell. You should be writing: # NB: no database statement before MAIN! MAIN DEFINE dbname CHAR(60) WHENEVER ANY ERROR STOP DEFER INTERRUPT DEFER QUIT -- Or maybe not... -- You'd verify that a database was specified LET dbname = ARG_VAL(1) -- You'd probably use WHENEVER ERROR CONTINUE and -- handle problems with the database name properly. DATABASE dbname CALL WhateverItIsThatDoesTheWork() END MAIN If you really must put a database statement where I said don't, then you can close the initially opened database before opening the new one. > First, I tried setting DATABASE to 'sysmaster' and changing the variable > after i4gl initialization steps. > > Does anyone have insight or suggestions as far as how to do this? (remember, > I'm new to this...) Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN Informix IDN for D4GL & Linux -- http://www.informix.com/idn