<?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: how to get std output from sqlplus ? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942735#M927156</link>
    <description>Thanks for your prompt answer.&lt;BR /&gt;I was forgotten about sqlplus scott/tiger @script.sql&lt;BR /&gt;&lt;BR /&gt;Something without creating any script file ( tee is something platform dependent )?&lt;BR /&gt;</description>
    <pubDate>Thu, 03 Apr 2003 07:42:00 GMT</pubDate>
    <dc:creator>Popeanga Marian_1</dc:creator>
    <dc:date>2003-04-03T07:42:00Z</dc:date>
    <item>
      <title>how to get std output from sqlplus ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942733#M927154</link>
      <description>echo 'select * from user_tables' |sqlplus scott/tiger&lt;BR /&gt;it doesn't print anything on the std output&lt;BR /&gt;Any ideas on how can i achive this ?</description>
      <pubDate>Thu, 03 Apr 2003 07:07:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942733#M927154</guid>
      <dc:creator>Popeanga Marian_1</dc:creator>
      <dc:date>2003-04-03T07:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to get std output from sqlplus ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942734#M927155</link>
      <description>You can do this a few different ways.  &lt;BR /&gt;&lt;BR /&gt;1.  The way that you are doing it should send out something.  I tried it for 9i on HP-UX 11.0 and it worked the way that I would expect&lt;BR /&gt;&lt;BR /&gt;2.  Something like the following:&lt;BR /&gt;echo "select * from user_tables;&lt;BR /&gt;exit;" &amp;gt; temp.sql&lt;BR /&gt;sqlplus scott/tiger @temp.sql&lt;BR /&gt;&lt;BR /&gt;3.  Something like the following:&lt;BR /&gt;sqlplus scott/tiger &amp;lt;</description>
      <pubDate>Thu, 03 Apr 2003 07:20:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942734#M927155</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2003-04-03T07:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to get std output from sqlplus ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942735#M927156</link>
      <description>Thanks for your prompt answer.&lt;BR /&gt;I was forgotten about sqlplus scott/tiger @script.sql&lt;BR /&gt;&lt;BR /&gt;Something without creating any script file ( tee is something platform dependent )?&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Apr 2003 07:42:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942735#M927156</guid>
      <dc:creator>Popeanga Marian_1</dc:creator>
      <dc:date>2003-04-03T07:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to get std output from sqlplus ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942736#M927157</link>
      <description>I'm not sure if it is platform dependant, but I do not think it is.  What it does it send the stdout to a file, as well as continuting to send it to stdout.  It is good for being able to monitor a process while logging it as well.  The "spool" command in sqlplus does the same thing, although that is dependant on accessing sqlplus correctly also.  &lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Thu, 03 Apr 2003 08:32:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942736#M927157</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2003-04-03T08:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to get std output from sqlplus ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942737#M927158</link>
      <description>I think i will use&lt;BR /&gt;sqlplus scott/tiger@sid @sql&lt;BR /&gt;and i need to fill this sql file with the proper command that i want to execute.&lt;BR /&gt;This wil work on any platform that Oracle Client sqlplus is instaled</description>
      <pubDate>Thu, 03 Apr 2003 09:01:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942737#M927158</guid>
      <dc:creator>Popeanga Marian_1</dc:creator>
      <dc:date>2003-04-03T09:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to get std output from sqlplus ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942738#M927159</link>
      <description>you may find the -s option handy. &lt;BR /&gt;&lt;BR /&gt;sqlplus -s scott/tiger @foo.sql &amp;gt;myStdOutput.txt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The -s is for silent and surpresses the boring version and other information that you may not care to have in your output file.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Apr 2003 13:36:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942738#M927159</guid>
      <dc:creator>R. Allan Hicks</dc:creator>
      <dc:date>2003-04-04T13:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to get std output from sqlplus ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942739#M927160</link>
      <description>THANKS YOU GUYS!</description>
      <pubDate>Sat, 05 Apr 2003 07:51:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942739#M927160</guid>
      <dc:creator>Popeanga Marian_1</dc:creator>
      <dc:date>2003-04-05T07:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to get std output from sqlplus ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942740#M927161</link>
      <description>Make sure that if you want it to be automated, that you end the sql file with "exit;" or it will not quit from sqlplus.  &lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Sat, 05 Apr 2003 08:41:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942740#M927161</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2003-04-05T08:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to get std output from sqlplus ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942741#M927162</link>
      <description>I guess you're trying to automate something from a shell script.&lt;BR /&gt;&lt;BR /&gt;Use the EOF.&lt;BR /&gt;&lt;BR /&gt;The following example is a script I use to connect to the database, spool a file then run the file. It is executed by cron.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;#set environment variables&lt;BR /&gt;&lt;BR /&gt;ORACLE_HOME=/oracle/product/8.1.7; export ORACLE_HOME&lt;BR /&gt;PATH=$ORACLE_HOME/bin:$PATH; export PATH&lt;BR /&gt;&lt;BR /&gt;USERID=XXX&lt;BR /&gt;PASSWORD=YYY&lt;BR /&gt;SID=ZZZ&lt;BR /&gt;&lt;BR /&gt;# logon to oracle&lt;BR /&gt;&lt;BR /&gt;$ORACLE_HOME/bin/sqlplus $USERID/$PASSWORD@$SID &amp;lt;&amp;lt; EOF&lt;BR /&gt;&lt;BR /&gt;set head off&lt;BR /&gt;set line 200&lt;BR /&gt;set pagesize 1000&lt;BR /&gt;set arraysize 1&lt;BR /&gt;&lt;BR /&gt;SELECT 'alter tablespace '||tablespace_name||' BEGIN BACKUP;'&lt;BR /&gt;FROM dba_tablespaces&lt;BR /&gt;&lt;BR /&gt;spool /tmp/BEGIN_BACKUP.sql&lt;BR /&gt;&lt;BR /&gt;/&lt;BR /&gt;&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;spool /tmp/BEGIN_BACKUP.log&lt;BR /&gt;&lt;BR /&gt;@/tmp/BEGIN_BACKUP.sql&lt;BR /&gt;&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;#after the oracle stuff then the shell script continues&lt;BR /&gt;&lt;BR /&gt;lp -dPrinter /tmp/BEGIN_BACKUP.log&lt;BR /&gt;&lt;BR /&gt;# and then maybe more oracle stuff&lt;BR /&gt;$ORACLE_HOME/bin/sqlplus $USERID/$PASSWORD@$SID &amp;lt;&amp;lt; EOF&lt;BR /&gt;&lt;BR /&gt;set head off&lt;BR /&gt;set line 200&lt;BR /&gt;set pagesize 1000&lt;BR /&gt;set arraysize 1&lt;BR /&gt;&lt;BR /&gt;SELECT 'alter tablespace '||tablespace_name||' END BACKUP;'&lt;BR /&gt;FROM dba_tablespaces&lt;BR /&gt;&lt;BR /&gt;spool /tmp/END_BACKUP.sql&lt;BR /&gt;&lt;BR /&gt;/&lt;BR /&gt;&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;spool /tmp/END_BACKUP.log&lt;BR /&gt;&lt;BR /&gt;@/tmp/END_BACKUP.sql&lt;BR /&gt;&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;# etc etc etc&lt;BR /&gt;------------------------------&lt;BR /&gt;&lt;BR /&gt;Notice the use of "EOF". This will cause a return to the shell script. Using this format keeps everything in one shell script and visible, not in multiple seperate .sql files. Also the .sql files produced are completely temporary.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rod</description>
      <pubDate>Tue, 15 Apr 2003 07:47:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942741#M927162</guid>
      <dc:creator>Rod White</dc:creator>
      <dc:date>2003-04-15T07:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to get std output from sqlplus ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942742#M927163</link>
      <description>easiest to implemt is the following.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SQLTASK=`select (your complete select statement including ; and all`&lt;BR /&gt;DOIT=$(echo ${SQLTASK} | sqlplus uname/passwd@wheteve.com)&lt;BR /&gt;&lt;BR /&gt;echo ${DOIT} | tee -a $OUTFILE</description>
      <pubDate>Wed, 16 Apr 2003 15:41:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942742#M927163</guid>
      <dc:creator>Donny Jekels</dc:creator>
      <dc:date>2003-04-16T15:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to get std output from sqlplus ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942743#M927164</link>
      <description>easiest to implemt is the following.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SQLTASK=`select (your complete select statement including ; and all`&lt;BR /&gt;DOIT=$(echo ${SQLTASK} | sqlplus uname/passwd@wheteve.com)&lt;BR /&gt;&lt;BR /&gt;echo ${DOIT} | tee -a $OUTFILE</description>
      <pubDate>Wed, 16 Apr 2003 15:42:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-std-output-from-sqlplus/m-p/2942743#M927164</guid>
      <dc:creator>Donny Jekels</dc:creator>
      <dc:date>2003-04-16T15:42:10Z</dc:date>
    </item>
  </channel>
</rss>

