Home » Infrastructure » Windows » problem creating an executable procedure
problem creating an executable procedure [message #195653] Sat, 30 September 2006 06:12 Go to next message
it_me24
Messages: 167
Registered: March 2006
Location: delhi
Senior Member
Hello Everyone!

I want to create an executable procedure, n did something like:

-> created the procedure p1 and

-> created the batch file test.bat as
c:\oracle\admin\bin\sqlplus.exe
connect system/manager@db1
execute p1;

n when i double click on the test.bat file, i get sqlplus login name n password.
?????????why it is prompting me for username n password, when i have already specified that in batch file.

thanks in advance.

Re: problem creating an executable procedure [message #195661 is a reply to message #195653] Sat, 30 September 2006 09:52 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
You could create the bat file as follows:
set path= c:\oracle\admin\bin

echo exec p1; | sqlplus system/manager@db1
Re: problem creating an executable procedure [message #195911 is a reply to message #195653] Tue, 03 October 2006 02:24 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
it_me24

why it is prompting me for username n password, when i have already specified that in batch file.
Yes, you did, but in the wrong place. At the moment you called SQLPLUS.EXE to be executed, .BAT script terminated its execution (sort of; perhaps it would be better to say paused) and the focus was now on SQL*Plus session, not OS command prompt's.

To connect to SQL*Plus, you are required to enter valid credentials - username, password (and, optionally, database) - and that's it.
Re: problem creating an executable procedure [message #196145 is a reply to message #195653] Wed, 04 October 2006 05:57 Go to previous messageGo to next message
it_me24
Messages: 167
Registered: March 2006
Location: delhi
Senior Member
thanks for your reply

But I am giving a valid username & password like

connect system/manager@db1

Is there any other way to pass the username & password to the SQL Plus thru .Bat file.

Appreciating response
Re: problem creating an executable procedure [message #196154 is a reply to message #196145] Wed, 04 October 2006 06:12 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
What are you trying to say? Are you getting an error?
Re: problem creating an executable procedure [message #196159 is a reply to message #195653] Wed, 04 October 2006 06:27 Go to previous messageGo to next message
it_me24
Messages: 167
Registered: March 2006
Location: delhi
Senior Member
I want to create an executable procedure, n i have created the batch file as shown above.
but when i am double clicking on batch file which i created , i get SQL PLUS login screen, which asks me to enter the username n password.

My question is Why is it not taking the username n passwd from batch file.


Appreciating Response
Re: problem creating an executable procedure [message #196163 is a reply to message #196159] Wed, 04 October 2006 06:41 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
It works for me without issue. Are you getting an error? Can you post exactly what your bat file looks like ?
Re: problem creating an executable procedure [message #196169 is a reply to message #195653] Wed, 04 October 2006 06:58 Go to previous messageGo to next message
it_me24
Messages: 167
Registered: March 2006
Location: delhi
Senior Member
My batch file contains:

c:\oracle\admin\bin\sqlplus.exe
connect system/manager@db1
execute p1;



Thanks
Re: problem creating an executable procedure [message #196170 is a reply to message #196169] Wed, 04 October 2006 07:04 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
You ask for a solution to your problem and one was proposed, yet you still want to revert to using YOUR same bat that doesn't work ???

See my solution above (THAT DOES WORK)!!!!
Re: problem creating an executable procedure [message #196172 is a reply to message #195653] Wed, 04 October 2006 07:07 Go to previous message
it_me24
Messages: 167
Registered: March 2006
Location: delhi
Senior Member
yes! thanks a ton it works....
Previous Topic: TNS Errors ORA-1203 and ORA-12222
Next Topic: installing oracle on windowns 2003
Goto Forum:
  


Current Time: Thu Nov 21 23:47:22 CST 2024