Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can this be done in Informix ?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
In Oracle, we can run an SQL script through the command line. Eg plus80w.exe scott/tiger@HOSTSTR script.sql
This would execute whatever inside script.sql

It comes handy if we need to run the script under a scheduler.

In Informix, do we have anything similar?

Thank you.
 
James:

Yes, you can do this from Informix. Using either the Informix isql or dbaccess utility you can:

dbaccess -e <dbname> script.sql

You don't provide a username/password since Informix uses the permissions of the user executing the script.

You can create more powerful scripts using unix shell variables with the help of unix &quot;here&quot; documents:

export userid=&quot;fred&quot;

dbaccess -e testdb <<MSG
select * from s_user where userid = &quot;$userid&quot;
MSG

I'd check out the dbaccess/isql documentation. I've just scratched the surface.

Regards,


Ed
Schaefer
olded@ix.netcom.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top