home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / database / informix / 1595 < prev    next >
Encoding:
Text File  |  1992-07-23  |  907 b   |  36 lines

  1. Newsgroups: comp.databases.informix
  2. Path: sparky!uunet!caen!sdd.hp.com!hp-col!judym
  3. From: judym@col.hp.com (Judy Miller)
  4. Subject: Is there a return code from isql?
  5. Sender: news@col.hp.com (Usenet News)
  6. Message-ID: <1992Jul23.170418.16866@col.hp.com>
  7. Date: Thu, 23 Jul 1992 17:04:18 GMT
  8. Organization: HP Colorado Springs Division
  9. Lines: 25
  10.  
  11. If I execute isql from a script, how can I test if it bombed?
  12.  
  13. (I didn't see any discussion in Appendix I, Accessing Programs from the
  14. Operating System.)
  15.  
  16. Example:   
  17. --------------------------
  18. $IFXDIR/isql -s <<-EOF
  19.    database aspdb;
  20.    delete from productdesc;
  21.    typo to make it bomb
  22.    load from "$ORBDIR/orb7050d" insert into productdesc;
  23. EOF
  24.  
  25. if [ $? -ne 0 ]; then
  26.    echo $?
  27. else
  28.    echo "OK"
  29. fi
  30. --------------------------
  31.  
  32. I'd like to test if it failed, but the following doesn't work since $? is 0.  
  33. I assume there must be something else I can test.
  34.  
  35. Judy
  36.