home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / database / informix / 1608 < prev    next >
Encoding:
Text File  |  1992-07-25  |  1.0 KB  |  37 lines

  1. Newsgroups: comp.databases.informix
  2. Path: sparky!uunet!sybus.sybus.com!myrddin!tct!jtt
  3. From: jtt@tct.com (John Tombs)
  4. Subject: Re: Is there a return code from isql?
  5. Message-ID: <2A7034E3.8863@tct.com>
  6. Date: Fri, 24 Jul 1992 16:50:43 GMT
  7. References: <1992Jul23.170418.16866@col.hp.com>
  8. Organization: TC Telemanagement, Clearwater, FL
  9. Lines: 26
  10.  
  11. In article <1992Jul23.170418.16866@col.hp.com> judym@col.hp.com (Judy Miller) writes:
  12. >If I execute isql from a script, how can I test if it bombed?
  13. >
  14. >Example:   
  15. >--------------------------
  16. >$IFXDIR/isql -s <<-EOF
  17. >   database aspdb;
  18. >   delete from productdesc;
  19. >   typo to make it bomb
  20. >   load from "$ORBDIR/orb7050d" insert into productdesc;
  21. >EOF
  22. >
  23. >if [ $? -ne 0 ]; then
  24. >   echo $?
  25. >else
  26. >   echo "OK"
  27. >fi
  28. >--------------------------
  29.  
  30. We redirect standard error to a temporary file, then grep it for error
  31. messages (all from within the script, of course). Clumsy, but it works.
  32.  
  33.  
  34. -- 
  35. John Tombs at Teltronics/TCT        <jtt@tct.com>,     <uunet!myrddin!tct!jtt>
  36.                      Real Modem Users Do It Internally.
  37.