<?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: Executing set of query in shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-set-of-query-in-shell-script/m-p/3925179#M761772</link>
    <description>Hy&lt;BR /&gt;&lt;BR /&gt;Try it like that:&lt;BR /&gt;&lt;BR /&gt;sqlplus -s "/ as sysdba" &amp;lt;&lt;EOF&gt;&lt;/EOF&gt; set heading off feedback off verify off&lt;BR /&gt; select 'db_name' || value from v\$parameter where name = 'db_name';&lt;BR /&gt; exit;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 12 Jan 2007 03:08:46 GMT</pubDate>
    <dc:creator>Oviwan</dc:creator>
    <dc:date>2007-01-12T03:08:46Z</dc:date>
    <item>
      <title>Executing set of query in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-set-of-query-in-shell-script/m-p/3925177#M761770</link>
      <description>Hi all&lt;BR /&gt;&lt;BR /&gt;Does anyone know executing plsql query In oracle?&lt;BR /&gt;I have sets of query in script but, it dose not run because system dose not recognize sets of query is sequential.&lt;BR /&gt;&lt;BR /&gt;how can I set the script to run sets of query is sequential.&lt;BR /&gt;&lt;BR /&gt;First. Login in oracle&lt;BR /&gt;Second. Run mutiple lines of query sequential&lt;BR /&gt;&lt;BR /&gt;script is below..&lt;BR /&gt;===================&lt;BR /&gt;sqlplus /nolog &amp;lt;&amp;lt; EOF &amp;gt; /oracle/x&lt;BR /&gt;connect / as sysdba&lt;BR /&gt;set linesize 200&lt;BR /&gt;select 'db_name  ' || value from v$parameter where name = 'db_name';&lt;BR /&gt;disconnect&lt;BR /&gt;EOF&lt;BR /&gt;==========================&lt;BR /&gt;But the output is disappointed&lt;BR /&gt;&lt;BR /&gt;SQL*Plus: Release 10.2.0.2.0 - Production on Fri Jan 12 16:35:19 2007&lt;BR /&gt;&lt;BR /&gt;Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; Connected.&lt;BR /&gt;SQL&amp;gt; SQL&amp;gt; select 'db_name  ' || value from v where name = 'db_name'&lt;BR /&gt;                                 *&lt;BR /&gt;ERROR at line 1:&lt;BR /&gt;ORA-00942: table or view does not exist&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jan 2007 02:47:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-set-of-query-in-shell-script/m-p/3925177#M761770</guid>
      <dc:creator>file system</dc:creator>
      <dc:date>2007-01-12T02:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Executing set of query in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-set-of-query-in-shell-script/m-p/3925178#M761771</link>
      <description>Your problem is caused by the $parameter, which is interpreted by the shell instead of being forwarded to the sqlplus command.&lt;BR /&gt;&lt;BR /&gt;This can be solved by escaping the '$' character with a backslash.&lt;BR /&gt;Your line will become:&lt;BR /&gt;select 'db_name ' || value from v\$parameter where name = 'db_name'&lt;BR /&gt;&lt;BR /&gt;Another solution, though a bit dirty: insert before the sqlplus command the following:&lt;BR /&gt;parameter='$parameter'&lt;BR /&gt;&lt;BR /&gt;Good luck</description>
      <pubDate>Fri, 12 Jan 2007 02:56:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-set-of-query-in-shell-script/m-p/3925178#M761771</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2007-01-12T02:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Executing set of query in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-set-of-query-in-shell-script/m-p/3925179#M761772</link>
      <description>Hy&lt;BR /&gt;&lt;BR /&gt;Try it like that:&lt;BR /&gt;&lt;BR /&gt;sqlplus -s "/ as sysdba" &amp;lt;&lt;EOF&gt;&lt;/EOF&gt; set heading off feedback off verify off&lt;BR /&gt; select 'db_name' || value from v\$parameter where name = 'db_name';&lt;BR /&gt; exit;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jan 2007 03:08:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-set-of-query-in-shell-script/m-p/3925179#M761772</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2007-01-12T03:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Executing set of query in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-set-of-query-in-shell-script/m-p/3925180#M761773</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;running PL/SQL is equally easy:&lt;BR /&gt;&lt;BR /&gt;$ sqlplus -s "/ as sysdba" &amp;lt;&amp;lt; EOF&lt;BR /&gt;&amp;gt; declare&lt;BR /&gt;&amp;gt;  mvar date;&lt;BR /&gt;&amp;gt; begin&lt;BR /&gt;&amp;gt;  select sysdate into mvar from dual;&lt;BR /&gt;&amp;gt;  dbms_output.put_line(mvar);&lt;BR /&gt;&amp;gt; end;&lt;BR /&gt;&amp;gt; /&lt;BR /&gt;&amp;gt; exit&lt;BR /&gt;&amp;gt; EOF&lt;BR /&gt;12-JAN-07&lt;BR /&gt;&lt;BR /&gt;PL/SQL procedure successfully completed.&lt;BR /&gt;&lt;BR /&gt;Elapsed: 00:00:00.03&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;$ sqlplus -s "/ as sysdba" &amp;lt;&amp;lt; EOF&lt;BR /&gt;&amp;gt; declare&lt;BR /&gt;&amp;gt;  mvar varchar2(30);&lt;BR /&gt;&amp;gt; begin&lt;BR /&gt;&amp;gt; from v\$parameter where name = 'db_name';&lt;BR /&gt;&amp;gt;  dbms_output.put_line(mvar);&lt;BR /&gt;&amp;gt; end;&lt;BR /&gt;&amp;gt; /&lt;BR /&gt;&amp;gt; exit&lt;BR /&gt;&amp;gt; EOF&lt;BR /&gt;db_name mydb&lt;BR /&gt;&lt;BR /&gt;PL/SQL procedure successfully completed.&lt;BR /&gt;&lt;BR /&gt;Elapsed: 00:00:00.05&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hope this helps too!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jan 2007 04:17:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-set-of-query-in-shell-script/m-p/3925180#M761773</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-01-12T04:17:19Z</dc:date>
    </item>
  </channel>
</rss>

