<?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 SQL scripts in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738420#M946465</link>
    <description>In shell scripts, I often call SQL like this :&lt;BR /&gt;sqlplus user/passw  &amp;lt;&amp;lt; END_SQL&lt;BR /&gt;select *&lt;BR /&gt;from table&lt;BR /&gt;EMD_SQL&lt;BR /&gt;&lt;BR /&gt;I found that this doesn't work, mostly if there are multiple calls from the same script&lt;BR /&gt;Does any one know the conditions?&lt;BR /&gt;</description>
    <pubDate>Wed, 05 Jun 2002 15:02:59 GMT</pubDate>
    <dc:creator>Fritz-Gerald: Zephir</dc:creator>
    <dc:date>2002-06-05T15:02:59Z</dc:date>
    <item>
      <title>SQL scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738420#M946465</link>
      <description>In shell scripts, I often call SQL like this :&lt;BR /&gt;sqlplus user/passw  &amp;lt;&amp;lt; END_SQL&lt;BR /&gt;select *&lt;BR /&gt;from table&lt;BR /&gt;EMD_SQL&lt;BR /&gt;&lt;BR /&gt;I found that this doesn't work, mostly if there are multiple calls from the same script&lt;BR /&gt;Does any one know the conditions?&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Jun 2002 15:02:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738420#M946465</guid>
      <dc:creator>Fritz-Gerald: Zephir</dc:creator>
      <dc:date>2002-06-05T15:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: SQL scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738421#M946466</link>
      <description>I never had any problem with this, even with multiple calls in one script. You have made sure that there are no indents between the two 'END_SQL's..'&lt;BR /&gt;&lt;BR /&gt;One point though... I'd always end each SQL statement with a ';' as in:&lt;BR /&gt;&lt;BR /&gt;sqlplus user/passw &amp;lt;&amp;lt; END_SQL &lt;BR /&gt;select * &lt;BR /&gt;from table ;&lt;BR /&gt;END_SQL &lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Duncan&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Jun 2002 15:08:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738421#M946466</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2002-06-05T15:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: SQL scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738422#M946467</link>
      <description>&lt;BR /&gt;Use perl:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.bookpool.com/.x/3dp5s6acd6/sm/1565926994" target="_blank"&gt;http://www.bookpool.com/.x/3dp5s6acd6/sm/1565926994&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;examples:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.oreilly.com/catalog/perldbi/chapter/ch04.html" target="_blank"&gt;http://www.oreilly.com/catalog/perldbi/chapter/ch04.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Wed, 05 Jun 2002 15:09:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738422#M946467</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-06-05T15:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: SQL scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738423#M946468</link>
      <description>The syntax is correct, Im quite sure.&lt;BR /&gt;I fI cut and paste it all in a new file, it works.&lt;BR /&gt;&lt;BR /&gt;It's like after x number of runs, it wont work&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;P.S. If I lived in a better place, then I would be allowed PERL</description>
      <pubDate>Wed, 05 Jun 2002 15:25:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738423#M946468</guid>
      <dc:creator>Fritz-Gerald: Zephir</dc:creator>
      <dc:date>2002-06-05T15:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: SQL scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738424#M946469</link>
      <description>One option, rather than piping the information, would be to create a sql script, or have a set prebuilt, that you can call from the command line:&lt;BR /&gt;&lt;BR /&gt;sqlscript.sql&lt;BR /&gt;connect scott/tiger&lt;BR /&gt;select * from table;&lt;BR /&gt;exit;&lt;BR /&gt;---&lt;BR /&gt;sqlplus /nolog @sqlscript.sql&lt;BR /&gt; -or-&lt;BR /&gt;sqlplus scott/tiger @sqlscript.sql&lt;BR /&gt;&lt;BR /&gt;Either way will get you out of piping information directly to the command.  One thing that I have found that can cause problems in the past (for me) is not outputting the information to something.&lt;BR /&gt;&lt;BR /&gt;ie:  &lt;BR /&gt;sqlplus &amp;lt;&amp;gt; /dev/null &lt;BR /&gt;connect internal&lt;BR /&gt;select * from table;&lt;BR /&gt;!&lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Thu, 06 Jun 2002 01:27:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738424#M946469</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2002-06-06T01:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: SQL scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738425#M946470</link>
      <description>The ; does it for me, but also make sure that you do not have empty lines in your script between statements.</description>
      <pubDate>Thu, 06 Jun 2002 05:43:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738425#M946470</guid>
      <dc:creator>Victor Geere</dc:creator>
      <dc:date>2002-06-06T05:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: SQL scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738426#M946471</link>
      <description>SQL Syntax is correct,&lt;BR /&gt;I actually work around it by creating a sql file and call it from sql.</description>
      <pubDate>Thu, 06 Jun 2002 13:31:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-scripts/m-p/2738426#M946471</guid>
      <dc:creator>Fritz-Gerald: Zephir</dc:creator>
      <dc:date>2002-06-06T13:31:17Z</dc:date>
    </item>
  </channel>
</rss>

