Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
>From: sinues@prcd.prc.mrms.navy.mil (John Sinues)
>Subject: Loading database from script files
>Date: 10 Aug 1994 09:42:32 -0500
>X-Informix-List-Id: <news.8098>
>I have an ASCII file containing a number of INSERT-INTO statements. I
>want to execute this file and load an Informix OnLine database. Two questions:
> 1. How can I load this script from the command line? Can I
> do something like this:
>
> isql -ansi {dbname} < {SQL_script.sql file}
Either: isql dbname - < script.sql
Or: isql dbname script.sql
You can use any name you like with I/O redirection. Your file name must
end .sql to be used as an argument, though you don't have to specify the
.sql suffix on the command line. Also works with dbaccess.
> 2. How should my SQL_script.sql file end? I have a "COMMIT WORK"
> statement at the end -- do I need anything else? ...
Just the COMMIT; Informix will stop when it reaches the end of file.
If you omit the commit, you effectively place a rollback there.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.