Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

command sqlplus

Status
Not open for further replies.

donny750

Programmer
Jul 13, 2006
145
FR
hello,

I've try to execute sqlplus command
i've make this
Code:
sqlplus -s user/passwd\@mydatabase select dummy from dual;

but i've nothing
when i run the command in output i've this
SQL*Plus: Release 10.2.0.2.0 - Production

Copyright (c) 1982, 2005, Oracle. All Rights Reserved.

Usage 1: sqlplus -H | -V

-H Displays the SQL*Plus version and the
usage help.
-V Displays the SQL*Plus version.

Usage 2: sqlplus [ [<option>] [<logon>] [<start>] ]

<option> is: [-C <version>] [-L] [-M "<options>"] [-R <level>] [-S]

-C <version> Sets the compatibility of affected commands to the
version specified by <version>. The version has
the form "x.y[.z]". For example, -C 10.2.0
-L Attempts to log on just once, instead of
reprompting on error.
-M "<options>" Sets automatic HTML markup of output. The options
have the form:
HTML [ON|OFF] [HEAD text] [BODY text] [TABLE text]
[ENTMAP {ON|OFF}] [SPOOL {ON|OFF}] [PRE[FORMAT] {ON|OFF}]
-R <level> Sets restricted mode to disable SQL*Plus commands
that interact with the file system. The level can
be 1, 2 or 3. The most restrictive is -R 3 which
disables all user commands interacting with the
file system.
-S Sets silent mode which suppresses the display of
the SQL*Plus banner, prompts, and echoing of
commands.

<logon> is: (<username>[/<password>][@<connect_identifier>] | /)
[AS SYSDBA
....

why ?

thanks
 
Have a look here: faq822-2218

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
i've seen
but i've a question
i've make this
echo "select * from dual;" | sqlplus -s user/pass@database

it's run but the return code is always 0;
if the pass are good or not , he always return 0

why ??
 
The echo succeeds, that's why you get a return code of 0. Why aren't you using print instead?

Alan Bennett said:
I don't mind people who aren't what they seem. I just wish they'd make their mind up.
 
Hi,

Another way using "here file"

Code:
sqlplus username/password@instance <<-!EOSQL
         WHENEVER SQLERROR  exit 5
         select dummy from dual;
         exit 0
!EOSQL

Ali
 
print is a ksh built-in only.

This should do the trick:

[tt]sqlplus -s user/pass@database << HERE
select * from dual;
HERE[/tt]

Annihilannic.
 
i've test your code aau

and i've return code equal 0 if it's run good and return code not equal to 0 if it's not run
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top