Execute Windows Command [message #651163] |
Thu, 12 May 2016 05:17 |
|
azamkhan
Messages: 557 Registered: August 2005
|
Senior Member |
|
|
Hi guys,
I want to execute a windows command CALC for executing calculator program from SQL prompt. I have tried to execute this from SQL environment but it is giving follwong error:
ORA-06550:
Pls-00201: Identifier 'HOST' must be declared
|
|
|
|
|
|
|
|
|
|
|
Re: Execute Windows Command [message #651176 is a reply to message #651167] |
Thu, 12 May 2016 06:31 |
|
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
azamkhan wrote on Thu, 12 May 2016 05:43I am using Oracle Database 10g. And wanted to issue a window command from a database stored procedure.
Stored procedures execute entirely within the database. They have no means of communicating with the user.
Why do you want to be able to execute the Windows calculator app from within a stored procedure? What is the larger problem you are trying to solve by doing so?
BTW, oracle 10 is long out of support. Even 11 is breathing its last.
[Updated on: Thu, 12 May 2016 06:32] Report message to a moderator
|
|
|
Re: Execute Windows Command [message #651177 is a reply to message #651173] |
Thu, 12 May 2016 06:34 |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
when I am in sqlplus and I type
HOST CALC
It opens the calculator and waits until I exit the calculator to continue in sqlplus. show up exactly what your test is doing. Also your site might have the host command disabled. It is fairly easy to do by entering a row into the system.product_user_profile table. For example, the following insert would disable the host command for every user on the database
INSERT INTO system.product_user_profile
(product,userid,attribute,scope,numeric_value,char_value)
VALUES
('SQL*Plus', '%', 'HOST', NULL, NULL, 'DISABLED');
[Updated on: Thu, 12 May 2016 06:35] Report message to a moderator
|
|
|
|
Re: Execute Windows Command [message #651179 is a reply to message #651178] |
Thu, 12 May 2016 06:44 |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
Impossible. A stored procedure runs on the database server, not on the host machine. HOST is a sqlplus command. a stored procedure is executed by the database engine, not sqlplus. Using dbms_schedule you can run a script in sqlplus but it will still run on the server, not the workstation.
[Updated on: Thu, 12 May 2016 06:50] Report message to a moderator
|
|
|
|
Re: Execute Windows Command [message #651182 is a reply to message #651181] |
Thu, 12 May 2016 07:26 |
|
Michel Cadot
Messages: 68641 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
This is a great topic for you.
You learned:
- what is an Oracle version
- you have to give us the name the tool you use
- you have to show us what you do and get.
Now, there are other other things you have to learn like how to correctly format a post.
They are in the links I gave you... if you can read... and memorize more than one thing... otherwise return back to them each time you write one line in a post and read them again.
[Updated on: Thu, 12 May 2016 07:27] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Execute Windows Command [message #651208 is a reply to message #651207] |
Thu, 12 May 2016 14:38 |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
Yes, that will work however it still will not work on the client. Unless the database is running on the local workstation, you will not see the calculator startup and if it does, it will be for the system account running the database. Not what you logged onto the database server as.
|
|
|
Re: Execute Windows Command [message #651210 is a reply to message #651208] |
Thu, 12 May 2016 14:50 |
|
Barbara Boehmer
Messages: 9088 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
It should execute the operating system command on the server. I don't know if CALC was just a simple example of an operating system command for testing or if that is the actual command needed. If CALC is the actual command needed, then it should not make any difference where the calculator comes from. It it is something else, then the bat file containing the commands will need to be on the server and run the commands on the operating system of the server.
On second thought, if it is something that can be run without needing to be seen, no problem. It just dawned on me that you are correct in that, although the calculator may pop up on the server, if your client is not on the server, as mine is, so I can't test it properly, then you may not see it, which obviously constitutes a problem.
[Updated on: Thu, 12 May 2016 14:54] Report message to a moderator
|
|
|
|
Re: Execute Windows Command [message #651220 is a reply to message #651210] |
Fri, 13 May 2016 02:08 |
John Watson
Messages: 8929 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
One could use the Scheduler to launch the job on the client, if one is using release 11.2.x or higher. 11.2 introduces the remote external job facility. You install the Scheduler Agent (off the Client CD) on the remote machine, which would be the client PC, and the Scheduler sends the job to it for execution. I have done this for demonstration purposes, but never at a production site.
|
|
|
Re: Execute Windows Command [message #651236 is a reply to message #651216] |
Fri, 13 May 2016 06:35 |
|
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
azamkhan wrote on Thu, 12 May 2016 23:29Barbara Boehmer wrote on Thu, 12 May 2016 14:50I don't know if CALC was just a simple example of an operating system command for testing
Yes its an example of an operating system command for testing purpose.
OK, but for real purposes, does the command need to be interactive with the use? And does it need to access files that are on the user's PC.
You get far better help if you describe the actual business problem and not some hypothetical technical solution.
|
|
|