We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

pass parameter in sqlplus

ewang1205
ewang1205 asked
on
Medium Priority
760 Views
Last Modified: 2012-05-11
The following command says TEST is not identified.  I use \oracle\ora92\BIN\sqlplus.exe  seems okay.  Thanks.

C:\oracle\10.2.0\BIN\sqlplus.exe -s user/password @c:\test.sql 'TEST'
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
Try TEST without the single quotes.

Can you post the contents of test.sql so I can see what it is supposed to do with the parameter?
Production Manager / Application Support Manager
CERTIFIED EXPERT
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Top Expert 2011

Commented:
- for instance you have more than 1 parameter,
assuming test.sql contain:

SELECT * FROM test
WHERE test_id  = &1
AND test_name = &2

- you would execute it as follows, using comma to separate the values:
SQL> @test.sql parameter1, parameter2
OR
C:\oracle\10.2.0\BIN\sqlplus.exe -s user/password @c:\test.sql 1,TEST

Author

Commented:
Yes, Should be '&1' instead of &1.  Thanks.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.