<?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 Scripts in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605491#M35040</link>
    <description>Try perl and the perl::dbi &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.saturn5.com/~jwb/dbi-examples.html" target="_blank"&gt;http://www.saturn5.com/~jwb/dbi-examples.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Other examples:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.cbc.umn.edu/~mayer/oratut/USfacts.html" target="_blank"&gt;http://www.cbc.umn.edu/~mayer/oratut/USfacts.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.cbc.umn.edu/~mayer/oratut/USgov.html" target="_blank"&gt;http://www.cbc.umn.edu/~mayer/oratut/USgov.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
    <pubDate>Fri, 02 Nov 2001 15:31:32 GMT</pubDate>
    <dc:creator>harry d brown jr</dc:creator>
    <dc:date>2001-11-02T15:31:32Z</dc:date>
    <item>
      <title>Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605483#M35032</link>
      <description>Hai All ,&lt;BR /&gt;&lt;BR /&gt;I have a shell script which executing successfully..In this shell script.....&lt;BR /&gt;&lt;BR /&gt;process.sh (Its a file name)&lt;BR /&gt;--------------&lt;BR /&gt;###&lt;BR /&gt;#!bin/sh&lt;BR /&gt;/oracle/bin/sqlplus &amp;lt;&amp;lt; EOF&lt;BR /&gt;spool /oracle/error.log&lt;BR /&gt;connect system/password&lt;BR /&gt;@/oracle/db_crt.sql&lt;BR /&gt;@/oracle/db_run.sql&lt;BR /&gt;disconnect&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;EOF&lt;BR /&gt;###################&lt;BR /&gt;&lt;BR /&gt;If i execute that script it will connect to the user system and it will execute the SQL files. Its running fine,But if any error occurs while executing the first script it will continue to the next SQL file...Is it possible to exit if any errors occurs while executing the first SQL script?????&lt;BR /&gt; &lt;BR /&gt;I need the condition like this:&lt;BR /&gt;---------------------------&lt;BR /&gt;If &amp;lt; SUCCESS&amp;gt; THEN&lt;BR /&gt;Continue NEXT&lt;BR /&gt;Else&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;Can any one help me?????&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Ra</description>
      <pubDate>Thu, 01 Nov 2001 05:38:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605483#M35032</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-11-01T05:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605484#M35033</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Heres a kluge u can try..till someone comes up with a more elegant solution :)&lt;BR /&gt;&lt;BR /&gt;Split the sqlplus invocation into two separate sqlplus invocations - the first one does a "@/oracle/db_crt.sql", while the second does a "@/oracle/db_run.sql".&lt;BR /&gt;&lt;BR /&gt;Redirect the output of the first sqlplus to a scratch file. &lt;BR /&gt;Before calling the second sqlplus, grep for an error message / error code in the scratch file. If you find any, exit.</description>
      <pubDate>Thu, 01 Nov 2001 06:40:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605484#M35033</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2001-11-01T06:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605485#M35034</link>
      <description>Hello Rajkumar,&lt;BR /&gt;&lt;BR /&gt;this is more a "database" question, than a scripting one, but anyway: try the command "set stoponerror on" - if may not be supported in "sqlplus" but it IS working inside "svrmgrl".&lt;BR /&gt;Then after the first error your session stops.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Wodisch</description>
      <pubDate>Thu, 01 Nov 2001 06:44:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605485#M35034</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2001-11-01T06:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605486#M35035</link>
      <description>Hai Wodish,&lt;BR /&gt;&lt;BR /&gt;If i set that clause in my sql script at SVRMGRL prompt, If the error occurs in the first file it will exit.. but it will continue with the second sql script because i am using again the same syntax for another sql file as mentioned above..Is there any other alternative way to accomplish this task??&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Raj</description>
      <pubDate>Fri, 02 Nov 2001 06:34:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605486#M35035</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-11-02T06:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605487#M35036</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;please note it is bad practice to put (Oracle) passwords in scripts for several obvious reasons: possible security breach, scripts need to be changed if password changes, ....&lt;BR /&gt;&lt;BR /&gt;I would opt for externally authenticated password (OPS$ login) for this user, with limited privleges, enable crontab, and disable login on Unix if possible.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;Thierry</description>
      <pubDate>Fri, 02 Nov 2001 08:23:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605487#M35036</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2001-11-02T08:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605488#M35037</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Follow the steps to exit if not successful&lt;BR /&gt;&lt;BR /&gt;yousqlscript.sql&lt;BR /&gt;if ( `echo $?` != 0) &lt;BR /&gt;then&lt;BR /&gt;echo "Script Execution Failure"&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Hope this will be the right answer for your question</description>
      <pubDate>Fri, 02 Nov 2001 10:13:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605488#M35037</guid>
      <dc:creator>ramesh_6</dc:creator>
      <dc:date>2001-11-02T10:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605489#M35038</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If you want to test the exit code of your SQL-prog, then make sure your SQL-script generates an exit code!!&lt;BR /&gt;&lt;BR /&gt;sqlplus / &amp;lt;&amp;lt; TTT&lt;BR /&gt;select * from doesnotexist;&lt;BR /&gt;exit&lt;BR /&gt;TTT&lt;BR /&gt;====&amp;gt; exit code = 0 !!!&lt;BR /&gt;&lt;BR /&gt;sqlplus / &amp;lt;&amp;lt; TTT&lt;BR /&gt;whenever sqlerror exit sql.sqlcode;&lt;BR /&gt;select * from doesnotexist;&lt;BR /&gt;exit&lt;BR /&gt;TTT&lt;BR /&gt;====&amp;gt; exit code = 174&lt;BR /&gt;&lt;BR /&gt;BUT:&lt;BR /&gt;sqlplus / &amp;lt;&amp;lt; TTT&lt;BR /&gt;whenever sqlerror exit sql.sqlcode;&lt;BR /&gt;select * from dual where 1=2;&lt;BR /&gt;exit&lt;BR /&gt;TTT&lt;BR /&gt;====&amp;gt; exit code = 0 !! (no records found = no error!)&lt;BR /&gt;&lt;BR /&gt;sqlplus / &amp;lt;&amp;lt; TTT&lt;BR /&gt;whenever sqlerror exit sql.sqlcode;&lt;BR /&gt;declare&lt;BR /&gt;    n   number;&lt;BR /&gt;begin&lt;BR /&gt;  select * into n from dual where 1 = 0;&lt;BR /&gt;end;&lt;BR /&gt;/&lt;BR /&gt;exit&lt;BR /&gt;TTT&lt;BR /&gt;====&amp;gt; exit code = 123 (PL/SQL block generates error when exception is not handled)&lt;BR /&gt;&lt;BR /&gt;good luck,&lt;BR /&gt;Thierry.</description>
      <pubDate>Fri, 02 Nov 2001 11:05:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605489#M35038</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2001-11-02T11:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605490#M35039</link>
      <description>Unless I am missing something, all I think you need is to add a line&lt;BR /&gt;  WHENEVER SQLERROR EXIT&lt;BR /&gt;after the connect, before the first script.&lt;BR /&gt;Unless either of the called scripts undoes this, eg with &lt;BR /&gt;  WHENEVER SQLERROR CONTINUE&lt;BR /&gt;that should give the result you seek.&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Nov 2001 15:04:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605490#M35039</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2001-11-02T15:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605491#M35040</link>
      <description>Try perl and the perl::dbi &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.saturn5.com/~jwb/dbi-examples.html" target="_blank"&gt;http://www.saturn5.com/~jwb/dbi-examples.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Other examples:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.cbc.umn.edu/~mayer/oratut/USfacts.html" target="_blank"&gt;http://www.cbc.umn.edu/~mayer/oratut/USfacts.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.cbc.umn.edu/~mayer/oratut/USgov.html" target="_blank"&gt;http://www.cbc.umn.edu/~mayer/oratut/USgov.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Nov 2001 15:31:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2605491#M35040</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-11-02T15:31:32Z</dc:date>
    </item>
  </channel>
</rss>

