SQL Error Checking in Shell Scripts
Posted in 1996
Your_Name_Here — — source: Informix-list mailing list archive (1991-1998)
Is there a graceful way to abort a shell script when an SQL error occurs? Currently, we are using shell scripts to run SQL to load flat files into tables using the following syntax: isql <database> load from "filename" insert into "tablename" One possible error that may result from this statement is: "846: Number of values in the load file is not equal to number of columns." What we would like to be able to do is trap this error and exit the shell script. All suggestions would be appreciated. Please respond via e-mail. Regards, Paul Carlton paul_carlton@hp-greeley-om2.om.hp.com