View Full Version : How can I : Connect in SQL*Plus using defined variables
Claus
10-30-2003, 07:45 AM
Hi there.
In SQL*Plus I am trying to do the following
DEFINE system_user_password = manager
DEFINE connect_string = mydb
connect system/&system_user_password@&connect_string
Why are the variables in the line above not substituted and what should I do
to make it work.
Thanks for your help.
Claus
Harald Maier
10-30-2003, 08:20 AM
"Claus" <clkhm@hotmail.com> writes:
Hi there. In SQL*Plus I am trying to do the following DEFINE system_user_password = manager DEFINE connect_string = mydb connect system/&system_user_password@&connect_string Why are the variables in the line above not substituted and what should I do to make it work.
,----[ Test session ]
| SQL> define pwd=tiger
| SQL> define srv=first
| SQL> connect scott/&pwd@&srv;
| Connected.
| SQL>
`----
Works fine for me. What is your error message?
Harald
mcstock
10-30-2003, 08:21 AM
works fine as written
do you have SCAN set to ON (the default) or OFF?
do you have DEFINE set to &? (the default)?
are the DEFINE values correct?
(i won't ask why you want to do this -- i'm sure you're aware of the
security hole you're setting up here)
"Claus" <clkhm@hotmail.com> wrote in message
news:3fa1332a$0$9809$edfadb0f@dread14.news.tele.dk... Hi there. In SQL*Plus I am trying to do the following DEFINE system_user_password = manager DEFINE connect_string = mydb connect system/&system_user_password@&connect_string Why are the variables in the line above not substituted and what should I
do to make it work. Thanks for your help. Claus
Claus
10-30-2003, 01:27 PM
Hi all,
I was going crazy there for a second.
The reason was that the defines were done wrongly.
I had written
DEFINE system_user_password=manager
instead of
DEFINE system_user_password = manager
Big difference.
Yes I am aware of the security implications. Trust me, that is of no concern
in this case.
Thanks for your quick answers.
Regards
Claus
MyLounge.com Site Map
Forum:
Cars,
Cell Phone,
Database,
Games,
Home Improvement,
IT,
Music,
School,
Sports,
Web Design,
Web Server,
Weight Loss
The MyLounge.com forum is intended for informational use only and should not
be relied upon and is not a substitute for any advice. The information contained
on MyLounge.com are opinions and suggestions of members and is not a representation
of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for
the accuracy, completeness or usefulness of any postings or the qualifications
of any person responding. Please consult a expert or seek the services of an
attorney in your area for more accuracy on your specific situation. Please note
that our forums also serve as mirrors to Usenet newsgroups. Many posts you see
on our forums are made by newsgroup users who may not be members of MyLounge.com
Term of Service
vBulletin v3.0.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.