<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Shell Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976753#M921576</link>
    <description>hi,&lt;BR /&gt;&lt;BR /&gt;Another option that might work for you would be to redirect sqlplus's output.  &lt;BR /&gt;&lt;BR /&gt;Like:&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;sqlplus -s scott/tiger &amp;lt;&lt;STOP&gt;&amp;gt; test.lst&lt;BR /&gt;@test&lt;BR /&gt;exit&lt;BR /&gt;STOP&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;then do a grep looking for errors!&lt;BR /&gt;&lt;BR /&gt;grep -i "ora" test.lst |mailx &lt;EMAIL&gt;&lt;BR /&gt;&lt;BR /&gt;or analyze the file using any method you want.&lt;BR /&gt;&lt;BR /&gt;Hope this helps!&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj&lt;BR /&gt;&lt;BR /&gt;&lt;/EMAIL&gt;&lt;/STOP&gt;</description>
    <pubDate>Tue, 20 May 2003 07:16:00 GMT</pubDate>
    <dc:creator>Yogeeraj_1</dc:creator>
    <dc:date>2003-05-20T07:16:00Z</dc:date>
    <item>
      <title>Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976748#M921571</link>
      <description>I have a shell script from which i'm calling a &lt;BR /&gt;Oracle script&lt;BR /&gt;&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;Sqlplus &amp;lt;..&amp;gt; @mysql.sql&lt;BR /&gt;&lt;BR /&gt;How can i check whther this SQL statement has been executed successfully ?&lt;BR /&gt;Inside my .sql file i have given "Whenever SQL error&lt;BR /&gt;Rollback and EXIT".&lt;BR /&gt;How can i know whether the SQL statement was successfull or rollbacked due to some SQL error?&lt;BR /&gt;&lt;BR /&gt;if [ $? = 0 ]&lt;BR /&gt;Will this work for SQL Statements ? &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Help !!!&lt;BR /&gt;&lt;BR /&gt;Raj&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 19 May 2003 19:29:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976748#M921571</guid>
      <dc:creator>Prabhu_7</dc:creator>
      <dc:date>2003-05-19T19:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976749#M921572</link>
      <description>The easiest way is to use the "test" function.&lt;BR /&gt;&lt;BR /&gt;test 'your commands'.&lt;BR /&gt;&lt;BR /&gt;I.E.&lt;BR /&gt;&lt;BR /&gt;if [ test 'mystuff.sh' ] ; then&lt;BR /&gt;   echo "It worked"&lt;BR /&gt;else&lt;BR /&gt;   echo "it failed ;("&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;you can also use the return value from the command.&lt;BR /&gt;ls /tmp&lt;BR /&gt;RETVAL=$?&lt;BR /&gt;if the return value is 0, then the command succeeded, if non 0, it failed..&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shannon&lt;BR /&gt;</description>
      <pubDate>Mon, 19 May 2003 19:34:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976749#M921572</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2003-05-19T19:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976750#M921573</link>
      <description>All that $? will tell you is the status of the sqlplus command itself. Unless sqlplus was unable to start (e.g. bad patch), all you will ever see is zero.&lt;BR /&gt;&lt;BR /&gt;You really have to do much more to get meaningful error codes. The typical approach is to add a spool filexxx command and then use grep/awk/perl to examine the spool file after sqlplus has completed. Moreover, because the same command might be run more than once at the same time, the better method is to have your shell script build your SQL script "on the fly" and create PID dependent temporary spool file names to avoid pathname collisions.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 19 May 2003 19:44:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976750#M921573</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-05-19T19:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976751#M921574</link>
      <description>I wanted for SQL Statement&lt;BR /&gt;&lt;BR /&gt;I have a shell script from which i'm calling a &lt;BR /&gt;Oracle script &lt;BR /&gt;&lt;BR /&gt;. &lt;BR /&gt;. &lt;BR /&gt;Sqlplus &amp;lt;..&amp;gt; @mysql.sql &lt;BR /&gt;&lt;BR /&gt;How can i check whther this SQL statement has been executed successfully ? &lt;BR /&gt;Inside my .sql file i have given "Whenever SQL error &lt;BR /&gt;Rollback and EXIT". &lt;BR /&gt;How can i know whether the SQL statement was successfull or rollbacked due to some SQL error? &lt;BR /&gt;&lt;BR /&gt;if [ $? = 0 ] &lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;&lt;BR /&gt;This works fine for Unix commands , but Will this work for SQL Statements also ? &lt;BR /&gt;&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;Help !!! &lt;BR /&gt;&lt;BR /&gt;Raj</description>
      <pubDate>Mon, 19 May 2003 19:45:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976751#M921574</guid>
      <dc:creator>Prabhu_7</dc:creator>
      <dc:date>2003-05-19T19:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976752#M921575</link>
      <description>Using an "exit 1" from sqlplus will change the status of $? to 1.&lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Mon, 19 May 2003 23:16:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976752#M921575</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2003-05-19T23:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976753#M921576</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;Another option that might work for you would be to redirect sqlplus's output.  &lt;BR /&gt;&lt;BR /&gt;Like:&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;sqlplus -s scott/tiger &amp;lt;&lt;STOP&gt;&amp;gt; test.lst&lt;BR /&gt;@test&lt;BR /&gt;exit&lt;BR /&gt;STOP&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;then do a grep looking for errors!&lt;BR /&gt;&lt;BR /&gt;grep -i "ora" test.lst |mailx &lt;EMAIL&gt;&lt;BR /&gt;&lt;BR /&gt;or analyze the file using any method you want.&lt;BR /&gt;&lt;BR /&gt;Hope this helps!&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj&lt;BR /&gt;&lt;BR /&gt;&lt;/EMAIL&gt;&lt;/STOP&gt;</description>
      <pubDate>Tue, 20 May 2003 07:16:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976753#M921576</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2003-05-20T07:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976754#M921577</link>
      <description>Hello,&lt;BR /&gt;another hint is to change the sql,&lt;BR /&gt;from&lt;BR /&gt;&lt;BR /&gt;whenever sql error rollback and exit ;&lt;BR /&gt;&lt;BR /&gt;to whenever sql error goto do_something;&lt;BR /&gt;&lt;BR /&gt;and the procedure&lt;BR /&gt;&lt;BR /&gt;do_something:&lt;BR /&gt;- signal the error&lt;BR /&gt;- rollback&lt;BR /&gt;- exit &lt;BR /&gt;&lt;BR /&gt;HTH, Massimo</description>
      <pubDate>Tue, 20 May 2003 08:42:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2976754#M921577</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-05-20T08:42:10Z</dc:date>
    </item>
  </channel>
</rss>

