Calling Program from Plsql
Hi all,
How can i call another program from a plsql code.
For example opening a notepad in windows from plsql code.
Please give detailed explanation
Thanks
Akshat
If the purpose is scheduling external programs, the best way would be to use the Oracle Scheduler.
[url http://docs.oracle.com/cd/E11882_01/server.112/e25494/schedover.htm#i1106753]Chapter 28, [url http://docs.oracle.com/cd/E11882_01/server.112/e25494/scheduse.htm#i1033533]Chapter 29 and [url http://docs.oracle.com/cd/E11882_01/server.112/e25494/schedadmin.htm#i1007589]Chapter 30 in the Administrator's Guide.
Particularly [url http://docs.oracle.com/cd/E11882_01/server.112/e25494/scheduse002.htm#CIAJCFHE]Techniques for external jobs.
Scheduler jobs is the best way, because security is built into the system - you can use proper O/S credentials, grant rights, etc.
Manually calling external jobs from PL/SQL is not as easy. It is possible using for example some Java stored procedure, but it is more difficult to ensure security - it can too easily open up for your database users to execute too many possible O/S commands ;-)
Edit:
PS: Tim Hall shows some examples of Scheduler usage [url http://www.oracle-base.com/articles/10g/Scheduler10g.php]here - one of the examples is calling a shell script (unix lingo for batch job ;-) )
Edited by: Kim Berg Hansen on Nov 30, 2011 12:56 PM
Similar Messages
-
Call Program from another Program using varient
Hi...
How to call program from program with varient....?
i have used submit but how to pass varient dynamically.
Regards,
ChintanHi,
Use the FM SUBMIT_REPORT
OR
SUBMIT <Program Name> VIA SELECTION-SCREEN
USING SELECTION-SET <VARIANT>
AND RETURN. -
FM to pass one variant to another called program from a calling program
Hi Gurus,
Please let me know the name of the function module to pass one variant to another called program from a calling program without displaying the selection screen of the called program.you can use fm rs_variant_fetch to retrieve the variant info.
Check the abap help on the statement submit to get info on how to call a program with variables, or a variant
Kind regards, Rob Dielemans -
PLSQL WANTS TO RUN WINDOWS PROGRAM FROM PLSQL PROCEDURE
WANTS TO RUN WINDOWS PROGRAM FROM PLSQL PROCEDURE.
I want to run EXE file from pl/sql program , i have tried host it does
work in pl/sql .
Is there any Solution to this problem
Thank youHi,
It sounds like what you are trying to do, is run one mapping in a pre-mapping process of another mapping. You use a wrapper that implements sqlplus_exec_template.sql in PL/SQL. Is that correct?
I don't think that by the way you execute this mapping, it ends up in the context of the process flow. The reason is because according to Warehouse Builder the mapping is being invoked standalone (through the wrapper that implements the template). As a result, the context in which Warehouse Builder would log the messages is lost.
What I suggest you do (assuming I understand the problem correctly), is run the mapping as a separate mapping in the process flow. Because in the current release we do not support passing output parameters in the process flow, you will have to (temporarily) store the results of the first mapping in a table and pick it up from there in the other mapping. In the next major release (autumn 2004) we will support passing parameters between activities.
Thanks,
Mark. -
Issue calling program from transaction with selection criteria
Hi Guys,
I ve a issue regarding calling a program from transaction.
There is a standard transaction calling a program using selection criteria no (say for eq 10 fields, just look at the eg below)
Submit <table-proname> and return using selection-set <table-varia>
With rbukrs = i_bkorm-burks Comp Code
with Revent = i_bkorm-event event
with rbelnr = ibkorm-belnr Doc no
with rgjahr = ibkorm-gjahr fiscal year
with ruzeit = ibkorm-ruzeit time
with rusnam = ibkorm-rusnam user name
And so on
Now, In my program selection screen i ve only three fields, (not all mentioned above)
Parameter:
Rbukrs type bukrs, comp code
Rbelnr type belnr, doc no
Rghar type gjahr. fiscal year
Now, i configure this transaction with this program i can able to run this program from transaction.
Is every thing go right, Pls give your sugg
Points & help awarded.
Thanks in advance.Hi,
you can call the program using 3 selection screen fields even though it is having 10 fileds, but before calling make sure that there is no mandatory fields (in rest of the 7 fields), then it will runs you report.
reward if needful.
Thanks,
Sreeram. -
Call Program from another Program using varient via Selection Screen
I am calling a standard report from my Z Program via Selection screen.
Is there any way to hide the Execute button that is seen when we see the called program selection screen?Hi Shyam,
Thanks for the quick reply.
But my requirement is to show the selection screen of called program as i need to make some values changes in the selection Screen.
However, the user can accidently click the execute button which i dont want thats why i need to hide the execute button.
My aim is to change values of selection screen but nto execute it.
Is it possible? -
Come back to calling program from Call Transaction
Hi,
From my program, i am calling a standard tcode :
Call Transaction - sy-calld is set in called transaction which deactivates some buttons there.
Leave To Trnasaction - sy-calld is not set , but then I am not able to come back to the calling program.
Please tell me how should this be achieved.
ThanksHi, shalaxy s
If you do mean calling the transaction and being able to go back !!
You can use the following
For Example : CALL TRANSACTION 'SE80' VIA SELECTION-SCREEN AND RETURN.
OR: CALL TRANSACTION 'SE80' AND SKIP FIRST SCREEN.
Best Reagrds, AlMaReD
Edited by: AlMaReD on Jun 12, 2010 9:47 AM -
Hi
I am trying to connect an external program(DLL) from pl/sql.
for the practice i trying to call "GetComputerName" from kernel32.dll.
i made the following step
1. Creating a library .
2. Creating a package .
3. Set the listener.ora
4. Set the tnsnames.ora.
After solving the problame with the settings of the listener.ora
I testing the function , it run with no error but return 'null' .
I thing the problems is with the "parameter"
I do not know of haw to send them .
----my pak-------------------------------
CREATE OR REPLACE Package Body K32 As
Function GetComputerNameK(lpBuffer out varchar2,nSize in out long )Return long Is
External
Library Sys.Kernel32 Name "GetComputerNameW"
Language c
WITH CONTEXT
PARAMETERS (
CONTEXT,
--lpBuffer STRING,
lpBuffer BY REFERENCE,
nSize BY REFERENCE,
--nSize INDICATOR short,*/
RETURN INDICATOR--,
/* RETURN short */);
End K32;Let me explain a bit what a VFP DLL is for:
You can only build one type of DLL, an OLE COM Server DLL. It'll mainly contain OLEPUBLIC class definitions, which are then usable in other programming languages. In any programming language capable to make use of OLE COM Server classes.
If your project is named mydll.pjx and a prg or vcx contains a class myclass, the final DLL will have the OLE class "mydll.myclass" in it.
This is overhead, if you use this in VFP. If you want to modularize your application, then create several EXE or build as APP. You can DO some.prg IN some.APP or you can create an object o = NEWOBJECT("myclass","myclasslib.vcx","myapp.app")
to refer to a class inside a vcx compiled and build together with other project files into an app file.
But any separation you do complicates the code use. A DLL is only needed, if some other programming language needs to use your VFP code. And that other programming language has to be able to instanciate classes.
You don't need this, even if other programming languages would be involved. You can compile an EXE and that can be run. If needed with parameters. That's typically much simpler and could even be used by DOS batch files either using the DOS start command
or directly your.EXE as man DOS commands also are merely EXE files.
Bye, Olaf.
Olaf Doschke - TMN Systemberatung GmbH http://www.tmn-systemberatung.de -
is it possible to call an java class stored on OS(unix/linux) from plsql ..does this java class need to be in database (RDBMS) or can plsql make a call at the OS level??
Hi Justin,
I have a similar requirement where I need to call a java method from PL/SQL code.
Basically we are developing an application using Oracle Apex where we pass the encrypted cookie content to this java method as a parameter and it returns the decrypted cookie content. Using the decrypted cookie info I would handle the authorization in my Apex application.
My company has standardized the cookie encryption/decryption method and thats what the security team provided me with 2 jar files which I am supposed to setup in class path. In one of this .jar files there is a .class file called GateKeeper.class.The whole cookie decryption code is in a method called 'decrypt_cookie' in the class file. Security team has provided me a sample call to this method using java as below :
<%@ page language="java" import="GateKeeper.*, java.util.*, java.io.*, java.net.*"%> …
String retString = GateKeeper.decrypt_cookie(secCookie);
All I need to do is call this piece of code from PL/SQL by passing the cookie value as a parameter, but not sure how to do it.
Following is the code I am using to capture cookie values coming from the browser.
DECLARE
c owa_cookie.cookie;
BEGIN
c := owa_cookie.get ('secCookie');
:P101_TXT_BOX := c.vals (1);
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;Can you explain what you mean by your point (2) "Java code can be declared as an external procedure in Oracle".
I am thinking for my situation your point (3) can be one of the solutions where I would load a java class into database which in turn would call GateKeeper.
Please suggest.
Thanks in advance.
-Raj. -
Call Program from an other one
Hallo,
I wonder if it is possible to call a standard Programm from my Report without leaving it. I have created a docking container that docks itself on each new Dynpro. Now if i call an extra Programm i don't have the d.container any more. I would like to see the d.container on the Dynpros of the new Programm as well. Is it possible?
Thank you very much,
AntonHi,
SDBILLDL is the std program for transaction VF04. This program is being called by other program as mentioned in the below code.
submit sdbilldl via job jobname
number jobcount
with p_vkorg = vkor1
with s_vtweg in so_vtweg
with s_spart in so_spart
with s_vstel in so_vstel
with p_fkdat = fkdat
with p_fkdab = fkdab
with p_kunnr in kunnr_sel
with p_fkart in x_fkart
with p_lland in x_lland
with s_vbeln in x_vbeln
with p_sort in x_sortk
with p_allea = allea
with p_allel = allel
with p_alleb = alleb
with p_allei = allei
with p_allef = allef
with no_faksk = no_faksk
with p_pdstk = p_pdstk
with p_samml = 'X'
WITH P_ANZEI = ANZEI
WITH P_VARNR = GS_SD_ALV-variant
and return . -
Hallow I build a function in se37 ,and in the function I wont to delete file from server now I have a program
in se 80 that can do that (YHR_DELETE_FILE_FROM_SERVER)the program have just one parameters (the path of the file I wont to delete )
How I can call to this program in my function.
regards
did some one now about function that can delete file from server?Hi antonio,
1.in se 80 that can do that (YHR_DELETE_FILE_FROM_SERVER)t
2. use like this in your FM
<b>SUBMIT YHR_DELETE_FILE_FROM_SERVER
WITH
parameter1 = myfilename.</b>
regards,
amit m. -
Calling JavaServlet from PLSQL cartridge
Could I call a Java procedure from a PLSQL Proc using Cartridges?
Hi Justin,
I have a similar requirement where I need to call a java method from PL/SQL code.
Basically we are developing an application using Oracle Apex where we pass the encrypted cookie content to this java method as a parameter and it returns the decrypted cookie content. Using the decrypted cookie info I would handle the authorization in my Apex application.
My company has standardized the cookie encryption/decryption method and thats what the security team provided me with 2 jar files which I am supposed to setup in class path. In one of this .jar files there is a .class file called GateKeeper.class.The whole cookie decryption code is in a method called 'decrypt_cookie' in the class file. Security team has provided me a sample call to this method using java as below :
<%@ page language="java" import="GateKeeper.*, java.util.*, java.io.*, java.net.*"%> …
String retString = GateKeeper.decrypt_cookie(secCookie);
All I need to do is call this piece of code from PL/SQL by passing the cookie value as a parameter, but not sure how to do it.
Following is the code I am using to capture cookie values coming from the browser.
DECLARE
c owa_cookie.cookie;
BEGIN
c := owa_cookie.get ('secCookie');
:P101_TXT_BOX := c.vals (1);
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;Can you explain what you mean by your point (2) "Java code can be declared as an external procedure in Oracle".
I am thinking for my situation your point (3) can be one of the solutions where I would load a java class into database which in turn would call GateKeeper.
Please suggest.
Thanks in advance.
-Raj. -
Call Function from PLSQL--ORA-31013 : Invalid XPATH expressioon
I tried the following SQL statement. when I called function,it giving error.
select *
from v$version;
1
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
2
PL/SQL Release 10.2.0.3.0 - Production
3
CORE 10.2.0.3.0
Production
4
TNS for Linux: Version 10.2.0.3.0 - Production
5
NLSRTL Version 10.2.0.3.0 - Production
function READ_SYSTEM_RESPONSE(PARAM IN CLOB)
RETURN NUMBER
AS
l_namespace varchar2(1000):='xsi:schemaLocation="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader PackageProxy.xsd"
xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader"
xmlns:ef="http://www.efatura.gov.tr/package-namespace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"';
x XMLTYPE
:= XMLTYPE('<?xml version="1.0" encoding="UTF-8"?>
<sh:StandardBusinessDocument xsi:schemaLocation="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader PackageProxy.xsd"
xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader"
xmlns:ef="http://www.efatura.gov.tr/package-namespace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<sh:StandardBusinessDocumentHeader>
<sh:HeaderVersion>1.0</sh:HeaderVersion>
</sh:StandardBusinessDocumentHeader>
</sh:StandardBusinessDocument>');
CURSOR ana IS
SELECT 1--EXTRACTVALUE(VALUE (p),'/sh:StandardBusinessDocumentHeader/sh:HeaderVersion',l_namespace) AS IMZA
FROM TABLE(XMLSEQUENCE (EXTRACT (x,'/sh:StandardBusinessDocument',l_namespace))) p;
BEGIN
FOR r IN ana
loop
dbms_output.put_line('- - - - - - -');
end loop;
RETURN 1;
EXCEPTION WHEN OTHERS THEN
dbms_output.put_line(sqlerrm);
RETURN 0;
END;odie_63 wrote:
Remove this from the l_namespace string, it has nothing to do in there, it's not a namespace declaration :
xsi:schemaLocation="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader PackageProxy.xsd
As a general rule, just declare the namespace(s) - default or prefixes - you need to resolve the XPath expression.
Once you correct that part, you'll discover that your query returns NULL.
That's because the XPath doesn't point to any node.
Try this instead :
SELECT EXTRACTVALUE(
VALUE (p)
, '/sh:StandardBusinessDocument/sh:StandardBusinessDocumentHeader/sh:HeaderVersion'
, l_namespace
) AS IMZA
FROM TABLE(
XMLSEQUENCE(
EXTRACT (x, '/sh:StandardBusinessDocument', l_namespace)
) p
Thanks odie_63,You're right. I removed " xsi:schemaLocation="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader PackageProxy.xsd" and It is working! -
Transfer control back to calling program from infotype screen
i've developed a module pool program that uses 'call transaction pa30'BDC to an custom infotype screen... after the 'save' button is pressed the control goes to the infotypes initial screen.
but i want the control to come back to the calling module pool program.. how do i do that??Hi Joseph,
have you considered using function module HR_INFOTYPE_OPERATION with parameter DIALOG_MODE = '2' instead of CALL TRANSACTION?
Regards,
Christian. -
Unable to call webservice from Plsql
Hi i am unable to invoke the web service i am getting the following error when i run the following coe can any one help out its great help thanks you
error->
ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException:
Caught exception while handling request: trailing block elements must have an id attribute
set serveroutput on
declare
service_ sys.utl_dbws.SERVICE;
call_ sys.utl_dbws.CALL;
service_qname sys.utl_dbws.QNAME;
port_qname sys.utl_dbws.QNAME;
operation_qname sys.utl_dbws.QNAME;
string_type_qname sys.utl_dbws.QNAME;
retx ANYDATA;
retx_string VARCHAR2(100);
retx_len number;
params sys.utl_dbws.ANYDATA_LIST;
v_Group_Id VARCHAR2(4);
v_Fund_Id VARCHAR2(6);
v_Query_Date DATE;
v_Query_Object VARCHAR2(2);
v_Error_Code VARCHAR2(30);
v_Error_Message VARCHAR2(2000);
begin
service_qname := sys.utl_dbws.to_qname(null, 'RealTime_Valu_WS');
service_ := sys.utl_dbws.create_service(service_qname);
port_qname := sys.utl_dbws.to_qname(null, 'RealTime_Valu_WSSoapHttpPort');
operation_qname := sys.utl_dbws.to_qname('http://RealTime_Valu_WS_Java/RealTime_Valu_WS.wsdl/types/', 'realtimeValWsElement');
call_ := sys.utl_dbws.create_call(service_, port_qname, operation_qname);
sys.utl_dbws.set_target_endpoint_address(call_, 'http://in-blr-tbpel1.igefi.tld/pa360/RealTime_Valu_WS_360/RealTime_Valu_WSSoapHttpPort');
string_type_qname := sys.utl_dbws.to_qname('http://www.w3.org/2001/XMLSchema', 'string');
sys.utl_dbws.add_parameter(call_, 'groupId', string_type_qname, 'ParameterMode.IN');
sys.utl_dbws.add_parameter(call_, 'flglnclsoft', string_type_qname, 'ParameterMode.IN');
sys.utl_dbws.add_parameter(call_, 'queryDate', string_type_qname, 'ParameterMode.IN');
sys.utl_dbws.add_parameter(call_, 'queryObject', string_type_qname, 'ParameterMode.IN');
sys.utl_dbws.add_parameter(call_, 'execTimestamp', string_type_qname, 'ParameterMode.IN');
sys.utl_dbws.add_parameter(call_, 'fundId', string_type_qname, 'ParameterMode.IN');
Sys.Utl_dbws.add_parameter(Call_,'Fund_Id' ,String_type_qname,'parameterMode.OUT');
Sys.Utl_dbws.add_parameter(Call_,'Query_Date' ,String_type_qname,'parameterMode.OUT');
Sys.Utl_dbws.add_parameter(Call_,'Query_Object' ,String_type_qname,'parameterMode.OUT');
Sys.Utl_dbws.add_parameter(Call_,'Error_Code' ,String_type_qname,'parameterMode.OUT');
Sys.Utl_dbws.add_parameter(Call_,'Error_Message',String_type_qname,'parameterMode.OUT');
sys.utl_dbws.set_return_type(call_, string_type_qname);
params(1) := ANYDATA.convertvarchar('MP1');
params(2) := ANYDATA.convertvarchar('Y');
params(3) := ANYDATA.convertvarchar('2009-01-30');
params(4) := ANYDATA.convertvarchar('C');
params(5) := ANYDATA.convertvarchar('00:00');
params(6) := ANYDATA.convertvarchar('MPNWS');
dbms_output.put_line('BEFORE INVOKING');
retx := sys.utl_dbws.invoke(call_, params); dbms_output.put_line('BEFORE PL/SQL DII client return ' || retx_string);
retx_string := retx.accessvarchar2;
dbms_output.put_line('AFTER PL/SQL DII client return ' || retx_string);
v_Group_Id := PARAMS(7).ACCESSVARCHAR2;
dbms_output.put_line('PL/SQL DII client return v_Group_Id ' || v_Group_Id);
v_Fund_Id := PARAMS(8).ACCESSVARCHAR2;
dbms_output.put_line('PL/SQL DII client return v_Group_Id ' || v_Group_Id);
v_Query_Date := PARAMS(9).ACCESSVARCHAR2;
dbms_output.put_line('PL/SQL DII client return v_Group_Id ' || v_Group_Id);
v_Query_Object := PARAMS(10).ACCESSVARCHAR2;
dbms_output.put_line('PL/SQL DII client return v_Group_Id ' || v_Group_Id);
v_Error_Code := PARAMS(11).ACCESSVARCHAR2;
dbms_output.put_line('PL/SQL DII client return v_Group_Id ' || v_Group_Id);
v_Error_Message := PARAMS(12).ACCESSVARCHAR2;
dbms_output.put_line('PL/SQL DII client return ' || retx_string);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Invoke_Ws : When Others -- '||SQLERRM(SQLCODE));
end;
my code is working only before the line of invoke statement..when invoke line is executed i am getting the error above mentioned
so any help!
thanks
VijayJinkala wrote:
any helpDon't use Java when PL/SQL is perfectly capable of doing the task at hand?
I have an inherent dislike of systems and application that have too many moving parts. Keep the moving parts to a minimum.. and the code is faster, more robust, and a lot easier to read, understand and maintain.
So in that regard, I do not understand what the deal is with utl_dbws and why it could not just use plain vanilla PL/SQL..? But then there are likely Java faithful that proclaims The Religion too when designing PL/SQL interface packages in Oracle... :-(
I've posted an example of how to call a web service using PL/SQL code only, no Java, in {message:id=4205205}.
Maybe you are looking for
-
Aging in Ar not showing any transaction but its showing all the payments
Hi can anyone help in regard of this problem when i am going to run 7bucket aging report in AR it doesn't showing any transaction but it shows only receipts. even the transaction is due i don't know why its not showing any transaction we have just ge
-
Problems with typing in mac os lion
hello, just two days ago I had some problems with my MacBook Pro running with Lion, I just went to update my mac os 10.7.3 to 10.7.4 and suddenly it failed to instal just then I was told to restart my computer. Ater I restarted the computer there was
-
Has anyone tried installing the Google Voice and Video plugin?
Hi, I wanted to check out the Hangouts feature at Google+, but I need the Google Voice and Video plugin for that. I tried unpacking the deb package supplied by Google and installing it manually, but the plugin does not work and Firefox just keeps cra
-
Filename/source window burn ??
Hi all Does anyone know a way to print/display or window burn (like the frame counter generator) the filename, that is, the name of the source clip on the video screen, for export aswel. Is there any plug-in available for this, because I couldn't fin
-
Hi All, I am using bapi for quotation creation BAPI_QUOTATION_CREATEFROMDATA2 I want to know how to use structure QUOTATION_CFGS_VALUE in BAPI_QUOTATION_CREATEFROMDATA2. This structure is used for Variant Configuration. Can you please help me. Than