Re: Launch an sql script...
Posted in 1998
On Wed, 12 Aug 1998, Florin Micle wrote: > Does anyone know if I can launch an Informix sql script from within another > script? > For example I have the script a.sql > and I want to run it from script b.sql. > Is there any way I can do that? > I know that in Oracle sql there is the '@' operator which does this job. > @ a.sql - runs the a.sql script. > I'm looking for some equivalent in Informix sql. No standard Informix-provided command interpreter handles that. You'd have to get SQLCMD from the IIUG archives to do that. SQLCMD uses the @ symbol to mark a statement which is less than one line long and does not need a semi-colon at the end, so it provides the input statement to redirect input (and output to redirect output, and error to redirect error messages): input a.sql; It also preserves the context when you start the script, so that the called script doesn't foul up any settings in the called script, such as by turning on tracing and leaving it on. Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix v0.59 -- http://www.perl.com/CPAN Informix IDN for D4GL & Linux -- http://www.informix.com/idn PS: Yes, I wrote SQLCMD.