<?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: sql command from a command shell in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046958#M749871</link>
    <description>sqlplus -S username/password@DB &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;select * form dual;&lt;BR /&gt;EOF</description>
    <pubDate>Tue, 15 May 2007 14:57:02 GMT</pubDate>
    <dc:creator>Sandman!</dc:creator>
    <dc:date>2007-05-15T14:57:02Z</dc:date>
    <item>
      <title>sql command from a command shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046957#M749870</link>
      <description>Hello Forum,&lt;BR /&gt;&lt;BR /&gt;I need to run an sql command from a unix shell command line with without loging into sqlplus and I can not use a script.&lt;BR /&gt;&lt;BR /&gt;When I try something like&lt;BR /&gt;&lt;BR /&gt;sqlplus -S login/password select * form dual&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I get an error messages&lt;BR /&gt;&lt;BR /&gt;SQL*Plus: Release 10.2.0.2.0 - Production&lt;BR /&gt;&lt;BR /&gt;Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.&lt;BR /&gt;&lt;BR /&gt;Usage 1: sqlplus -H | -V&lt;BR /&gt;&lt;BR /&gt;    -H             Displays the SQL*Plus version and the&lt;BR /&gt;                   usage help.&lt;BR /&gt;    -V             Displays the SQL*Plus version.&lt;BR /&gt;&lt;BR /&gt;Usage 2: sqlplus [ [] [&lt;LOGON&gt;] [&lt;START&gt;] ]&lt;BR /&gt;&lt;BR /&gt;   is: [-C &lt;VERSION&gt;] [-L] [-M "&lt;OPTIONS&gt;"] [-R &lt;LEVEL&gt;] [-S]&lt;BR /&gt;&lt;BR /&gt;    -C &lt;VERSION&gt;   Sets the compatibility of affected commands to the&lt;BR /&gt;                   version specified by &lt;VERSION&gt;.  The version has&lt;BR /&gt;                   the form "x.y[.z]".  For example, -C 10.2.0&lt;BR /&gt;    -L             Attempts to log on just once, instead of&lt;BR /&gt;                   reprompting on error.&lt;BR /&gt;    -M "&lt;OPTIONS&gt;" Sets automatic HTML markup of output.  The options&lt;BR /&gt;                   have the form:&lt;BR /&gt;                   HTML [ON|OFF] [HEAD text] [BODY text] [TABLE text]&lt;BR /&gt;                   [ENTMAP {ON|OFF}] [SPOOL {ON|OFF}] [PRE[FORMAT] {ON|OFF}]&lt;BR /&gt;    -R &lt;LEVEL&gt;     Sets restricted mode to disable SQL*Plus commands&lt;BR /&gt;                   that interact with the file system.  The level can&lt;BR /&gt;                   be 1, 2 or 3.  The most restrictive is -R 3 which&lt;BR /&gt;                   disables all user commands interacting with the&lt;BR /&gt;                   file system.&lt;BR /&gt;    -S             Sets silent mode which suppresses the display of&lt;BR /&gt;                   the SQL*Plus banner, prompts, and echoing of&lt;BR /&gt;                   commands.&lt;BR /&gt;&lt;BR /&gt;  &lt;LOGON&gt; is: (&lt;USERNAME&gt;[/&lt;PASSWORD&gt;][@&lt;CONNECT_IDENTIFIER&gt;] | /)&lt;BR /&gt;              [AS SYSDBA | AS SYSOPER] | /NOLOG&lt;BR /&gt;&lt;BR /&gt;    Specifies the database account username, password and connect&lt;BR /&gt;    identifier for the database connection.  Without a connect&lt;BR /&gt;    identifier, SQL*Plus connects to the default database.&lt;BR /&gt;&lt;BR /&gt;    The AS SYSDBA and AS SYSOPER options are database administration&lt;BR /&gt;    privileges.&lt;BR /&gt;&lt;BR /&gt;    The /NOLOG option starts SQL*Plus without connecting to a&lt;BR /&gt;    database.&lt;BR /&gt;&lt;BR /&gt;  &lt;START&gt; is: @&lt;URL&gt;|&lt;FILENAME&gt;[.&lt;EXT&gt;] [&lt;PARAMETER&gt; ...]&lt;BR /&gt;&lt;BR /&gt;    Runs the specified SQL*Plus script from a web server (URL) or the&lt;BR /&gt;    local file system (filename.ext) with specified parameters that&lt;BR /&gt;    will be assigned to substitution variables in the script.&lt;BR /&gt;&lt;BR /&gt;When SQL*Plus starts, and after CONNECT commands, the site profile&lt;BR /&gt;(e.g. $ORACLE_HOME/sqlplus/admin/glogin.sql) and the user profile&lt;BR /&gt;(e.g. login.sql in the working directory) are run.  The files may&lt;BR /&gt;contain SQL*Plus commands.&lt;BR /&gt;&lt;BR /&gt;Refer to the SQL*Plus User's Guide and Reference for more information.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;############################&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Is this even possible?&lt;BR /&gt;Can I pass on the select statement without having to encapsulate it on a sql script?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;/PARAMETER&gt;&lt;/EXT&gt;&lt;/FILENAME&gt;&lt;/URL&gt;&lt;/START&gt;&lt;/CONNECT_IDENTIFIER&gt;&lt;/PASSWORD&gt;&lt;/USERNAME&gt;&lt;/LOGON&gt;&lt;/LEVEL&gt;&lt;/OPTIONS&gt;&lt;/VERSION&gt;&lt;/VERSION&gt;&lt;/LEVEL&gt;&lt;/OPTIONS&gt;&lt;/VERSION&gt;&lt;/START&gt;&lt;/LOGON&gt;</description>
      <pubDate>Tue, 15 May 2007 14:52:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046957#M749870</guid>
      <dc:creator>Innopath Support</dc:creator>
      <dc:date>2007-05-15T14:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: sql command from a command shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046958#M749871</link>
      <description>sqlplus -S username/password@DB &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;select * form dual;&lt;BR /&gt;EOF</description>
      <pubDate>Tue, 15 May 2007 14:57:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046958#M749871</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-05-15T14:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: sql command from a command shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046959#M749872</link>
      <description>Hit the submit button prematurely as here's another way of doing the same thing:&lt;BR /&gt;&lt;BR /&gt;# echo 'select * from dual;' | sqlplus -S login/password</description>
      <pubDate>Tue, 15 May 2007 15:01:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046959#M749872</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-05-15T15:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: sql command from a command shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046960#M749873</link>
      <description>Try this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;echo "select * form dual" | sqlplus -S login/password &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 May 2007 15:03:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046960#M749873</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-05-15T15:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: sql command from a command shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046961#M749874</link>
      <description>Sanman and heuvel,&lt;BR /&gt;&lt;BR /&gt;Both options works and the one that best fit what I need is&lt;BR /&gt;echo "select * from dual;"|sqlplus -S login/password@&lt;DATABASE&gt;.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;/DATABASE&gt;</description>
      <pubDate>Tue, 15 May 2007 15:11:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046961#M749874</guid>
      <dc:creator>Innopath Support</dc:creator>
      <dc:date>2007-05-15T15:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: sql command from a command shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046962#M749875</link>
      <description>Just be aware of the fact that when you run this comand the user/password is shown in the process list. This could be a security issue.&lt;BR /&gt;&lt;BR /&gt;It would be better if you used the user/password as part of the piped input.&lt;BR /&gt;&lt;BR /&gt;ex.&lt;BR /&gt;sqlplus -S &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;username/password@DB&lt;BR /&gt;select * from dual;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;sqlplus -S &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;/ as sysdba&lt;BR /&gt;select * from dual;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;For this specific request it is no big danger, but this might be important if you run a task that need some runtime.&lt;BR /&gt;&lt;BR /&gt;/Tor-Arne</description>
      <pubDate>Fri, 18 May 2007 15:44:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046962#M749875</guid>
      <dc:creator>Tor-Arne Nostdal</dc:creator>
      <dc:date>2007-05-18T15:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: sql command from a command shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046963#M749876</link>
      <description>This is a good point.&lt;BR /&gt;&lt;BR /&gt;thanks Tor-Arne.</description>
      <pubDate>Fri, 18 May 2007 16:21:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-from-a-command-shell/m-p/5046963#M749876</guid>
      <dc:creator>Innopath Support</dc:creator>
      <dc:date>2007-05-18T16:21:31Z</dc:date>
    </item>
  </channel>
</rss>

