How to call external Perl routines from Pl/SQL - Urgent
Available software in the Test Environment:
1. Sun Unix 2.8
2. Oracle 8.1.7 ( 8i)
3. Perl 5
Iam trying to call/execute perl scripts from PL/SQL using the DEMO_RDBMS.mk. I am able to call C scripts from PL/SQL, but actually want to call Perl scripts.
The steps followed for for C are -
1. Create and compile a simple C program to execute a unix command (eg., touch a file).
2. Make a shared library of the above compiled program (object), i.e., load the compiled object module into a dynamic load library.
3. Declare the above library in Oracle using SQL*Plus.
4. Define a PL/SQL function or procedure to call the external routine.
5. Test the external routine.
The above steps run good for a C program, but step 2 fails when run for a Perl script.
When I tried to use the following command for step 2 -
make -f $ORACLE_HOME/rdbms/demo/demo_rdbms.mk extproc_callback \
SHARED_LIBNAME=cmd_lib.so \
OBJS=tst_cmd.pl
got the following error -
ld: fatal: file tst_cmd.pl: unknown file type.
ld: fatal: File processing errors. No output written t cmd_lib.so
*** Error code 1
This gives me an indication that demo_rdbms.mk does not understand/interpret Perl scripts. Going through the demo_rdbms.mk suggests the same.
My questions is - How do we call external Perl scripts/routines from PL/SQL ??
Do I have to get a different version of "demo_rdbms.mk" ?
PS: The perl scripts used above (tst_cmd.pl) is error free and works as intended in the unix environment.
Iam trying to call/execute perl scripts from PL/SQL using the DEMO_RDBMS.mk. I am able to call C scripts from PL/SQL, but actually want to call Perl scripts. Well, C is a "compiler" language and Perl is interpreted. In a sense, C is not "scripts".
When I tried to use the following command for step 2 -
make -f $ORACLE_HOME/rdbms/demo/demo_rdbms.mk extproc_callback \
SHARED_LIBNAME=cmd_lib.so \
OBJS=tst_cmd.pl
got the following error -
ld: fatal: file tst_cmd.pl: unknown file type.
ld: fatal: File processing errors. No output written t cmd_lib.soI guess this compiles an extproc "stub" with your object file, generating an external procedure. So the object file really needs to be an object file :-)
My questions is - How do we call external Perl scripts/routines from PL/SQL ??I'd guess you need an embedded Perl interpreter in the external procedure.
Not much help though I'm afraid :-/
Cheers
Fredrik
Similar Messages
-
Problems calling external C routines from PL/SQL
Hi everybody!
I'm not familiar with C programming in Unix, but I'm trying to make work an example to execute external procedures (developed in C) from PL/SQL.
The example includes .c and .pc source files, which I have compiled succesfully.
After that, links the .o files into .so to declare later as libraries in the Oracle database.
The problem appears when I try to execute this procedures (from PL), when a I get the error:
"Error loading external library"
"ORA-06522: ld.so.1: ORACLE_HOME/bin/extprocPLSExtProc: fatal:
relocation error: file /opt/mqm/lib/libmqm.so: symbol NULL_HSHMEMS: referenced symbol not found"
The library /opt/mqm/lib/libmqm.so is provided with the installation of MQSeries Server.
Thanx in advance.
Luisa.Here is what works on my system:
TNSNAMES.ORA:
EXTPROC_CONNECTION_DATA.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
LISTENER.ORA:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /home/oracle/Ora9i)
(PROGRAM = extproc) -
How to call a perl script from an apple script
Hi All,
How to Call a perl Script from an apple script.
Pls Give Your comments.
Thanx & Regards,
EstherApplescript to call a perl script named "/tmp/x.pl" passing an argument "world"
do shell script "/usr/bin/perl /tmp/x.pl world"
or if the script is given the executable atttribute (chmod +x /tmp/x.pl),
do shell script "/tmp/x.pl world"
Perl script "/tmp/x.pl" that prints a string using a passed argument
#!/usr/bin/perl
print "Hello $ARGV[$1]\n"; -
How to call external Java code from Animate project?
I am creating a trainer using Animate that needs to interface with an aircraft model written in Java. Is there a way to call external Java functions from Animate?
Thanks!you can import external java files by yepnope
yepnope({nope:[
'your java script file address.js',
],complete: init});
function init() {
codes that work with your js file can be write in here
Zaxist -
How to call external http client from abap system
Hi All,
I have browsed through sdn and google but not found any helpful document ,
Here my requirement is to call external http client from ecc ,
Pl suggest..,
Regards,
Lokeswar .Hi Deepak,
I have followed the below Reference links :
Example Program: Executing an HTTP Request - Components of SAP Communication Technology - SAP Library
http://scn.sap.com/thread/2035765
but while executing get http responce i'm facing 'HTTP_COMMUNICATION_FAILURE' error
CALL METHOD L_HTTP_CLIENT->RECEIVE
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2
HTTP_PROCESSING_FAILED = 3.
Pl suggest , -
Calling a Perl code from pl sql
Hi,
I have to carry out a process -wherein - i need to execute 2 plsql procedures and a perl function in between the two. The first pl sql procedure creates a file - which needs to be worked on by the perl file and processed and the resulting file is used by the second and last pl sql procedure. Is there any way to pull this off?
thanksI would seriously question the architecture here... That being said, depending on the Oracle version,
1) A shell script/ external process could
- invoke SQL*Plus, run the first procedure
- Call the Perl script
- invoke SQL*Plus, run the second procedure
2) The Perl script could do the same thing (i.e. connect to the database, run the first procedure, process the file, run the second procedure)
3) A SQL*Plus script could connect to the database, run the first procedure, use the HOST command to invoke the Perl script, and then call the second procedure.
4) A Java stored procedure could call out to the operating system to invoke the Perl script and a PL/SQL procedure could then invoke procedure 1, this new Java stored procedure, and then procedure 2.
5) (10g and later) You can call procedure 1, then create a one-time DBMS_SCHEDULER job that calls the perl script, then call procedure 2.
Justin -
How to call a perl module from Java program.
Hi,
I create a simple java program as follows
class test{
public static void main(String args[])
{try {
Runtime r = Runtime.getRuntime();
r.exec("perl test.pl");
catch(Exception e)
{e.printStackTrace();}
and test.pl is located in the same directory as the java program. The program compiles but with no return as I execute it. I am not sure what is wrong.
Thanks,I think the wrong line is here; r.exec("perl test.pl");
Usually the JVM needs the full path.If the path for either the executable or the script was wrong then, given the code posted, it would not hang.
>
To automatticaly get the path (if the file is in the
class path) use
System.getProperty("java.class.path")
That gets paths(plural).
Try this:
r.exec("perl " +
System.getProperty("java.class.path") + "\test.pl");I am rather certain that that won't work on any standard operating system. -
Calling external sub-routine from script
asap.
this simple example can help you out i hope.
in the script,
/: PERFORM WAREHOUSE IN PROGRAM ZWAREHOUSE
/: USING &WERKS&
/: USING &LGORT&
/: CHANGING &FLAG&
/: ENDPERFORM
/: IF &FLAG& NE 'X'
<print the data>
/: ENDIF
in the program zwarehouse,
FORM warehouse TABLES fp_in STRUCTURE itcsy
fp_out STRUCTURE itcsy.
TABLES t320.
DATA : l_werks LIKE resbd-werks,
l_lgort LIKE resbd-lgort,
l_flag(1) type c.
clear : l_werks, l_lgort, l_FLAG.
READ TABLE fp_in INDEX 1.
l_werks = fp_in-value.
READ TABLE fp_in INDEX 2.
l_lgort = fp_in-value.
SELECT SINGLE *
FROM t320
WHERE werks EQ l_werks AND
lgort EQ l_lgort.
IF SY-SUBRC EQ 0.
l_flag = 'X'.
ENDIF.
READ TABLE fp_out INDEX 1.
fp_out-value = l_flag.
MODIFY fp_out INDEX sy-tabix.
ENDFORM. "WAREHOUSE -
Calling external C procedures from PL/SQL
Hello,
The first two development steps for external C procedures are:
1. Create and compile the external procedure in 3GL.
2. Link the external procedure with the standard shared library at the operating system level.
For others, for example for 3. Create an alias library schema object to map to the operating system's shared library, i can see details of how to do this, but for first two, i see "Varies for each operating system; consult documentation".
My question is, how can 1 and 2 be done, in case of Windows? So i have the .c file, where i've written a procedure. And next what should i do for the first two steps?
ThanksRoger22 wrote:
The "standard shared library at the operating system level", is that .dll file, isn't it?Yep. On Linux/Unix these are actually called shared libraries. -
How to call a web service from PL/SQL?
The link to this article seems to be gone, and I can't find much information out there? Does anyone have a link that works? Or perhaps archived the old article at the bottom of this page:
http://www.oracle-base.com/articles/9i/ConsumingWebServices9i.phpDear,
I have read your article, it is useful for me. But I cannot Apply to my case. Please kindly help me. Thank you.
When running, the error occurs:
1:39:31 Execution failed: ORA-20000: soapenv:Server.userException - org.xml.sax.SAXParseException: Attribute name "password" associated with an element type "user" must be followed by the ' = ' character.
My webservice Url: http://abc.com.vn:81/axis/ABC_WS_TEST.jws?wsdl
I make PL/SQL (similiar as your example)
FUNCTION INVOKESENDMT
RETURN VARCHAR2
AS
l_request soap_api.t_request;
l_response soap_api.t_response;
l_return VARCHAR2(32767);
l_url VARCHAR2(32767);
l_namespace VARCHAR2(32767);
l_method VARCHAR2(32767);
l_soap_action VARCHAR2(32767);
l_result_name VARCHAR2(32767);
p_zipcode VARCHAR2(160);
BEGIN
--p_zipcode:='''TEST'' ; ''TEST'';''84912187098'';''84912187098'';''0'';''8118'';''1'';''000001'';''ThuNghiem'';''''';
p_zipcode:='TEST';
-- Set proxy details if no direct net connection.
--UTL_HTTP.set_proxy('myproxy:4480', NULL);
--UTL_HTTP.set_persistent_conn_support(TRUE);
-- Set proxy authentication if necessary.
--soap_api.set_proxy_authentication(p_username => 'TEST',
-- p_password => 'TEST');
l_url := 'http://abc.com.vn:81/axis/ABC_WS_TEST.jws';
l_namespace := 'xmlns="' || l_url || '"';
l_method := 'sendMT';
l_soap_action := l_url || '#sendMT';
l_result_name := 'sendMTResponse';
l_request := soap_api.new_request(p_method => l_method,
p_namespace => l_namespace);
soap_api.add_parameter(p_request => l_request,
p_name => 'user password sender receiver chargedflag servicenumber messagetype messageid textcontent binarycontent',
p_type => 'xsd:string',
p_value => p_zipcode);
l_response := soap_api.invoke(p_request => l_request,
p_url => l_url,
p_action => l_soap_action);
l_return := soap_api.get_return_value(p_response => l_response,
p_name => l_result_name,
p_namespace => l_namespace);
RETURN l_return;
END; -
How to call external files from java?
How to call external files in java. For example how to call a *.pdf file to open in its default editor(say Acrobat), or a *.html file to open in the default browser or a *.txt file in a notepad etc..,
In my program i have *.chm (Compiled Windows HTML Help) help file. how to open it in its default editor it?Jayarathina_Madharasan wrote:
no one answered my questionHi what wrong did i do...basically insulted all the volunteers here who took the time to consider your question and try to offer you help. Other than that, you did nothing wrong.
From JavaRanch :
And even if an answer doesn't solve your problem, even if it should totally miss the point - the best thing to do to motivate others to continue trying to help you is showing respect and gratitude for the investment of time that was put into dealing with your issue.
Edited by: Encephalopathic on Apr 14, 2008 10:01 AM -
How to call external application (transaction launcher) from event method
Hi all
Can somebody tell me which program lines to put into an event handler method in a view controller to get an external application called. I intend to define the link to the external application in the Transaction Launcher. But I cannot find any instructions on how to call the Transaction Launcher from my event handler method. I do not want to launch the application from the navigation bar, ONLY via a link in a list of invoices in a table view, and I want to press the invoice number to get an external application called to display the invoice. My event handler method gets called fine enough, but I have no clue which program lines to put into the method to pass on the call to the Transaction Launcher
Best regards
Arne Thage / MarchIT / Denmarkhi,
check class CL_CRM_UI_LTX_NAVBAR_PARAM.
call method : CREATE_PARAMETER_OBJECT with parameters
IV_LINK_ID Importing Type CRMT_UI_LOGICAL_LINK_ID Logical Link ID
IV_PARAMETER Importing Type CRMT_UI_LINK_PARAMETER Link Parameter
RV_RESULT Returning Type Ref To IF_BOL_BO_PROPERTY_ACCESS BO Attribute
I think it should work but have never done myself.
Best Regards
Pankaj Kumar -
I want to call External Java class from the PL/SQL
Hi,
I am using Oracle Apps R11i (11.5.7), I wanted to call external Java class from the PL/SQL. This external Java class is residing in another application server.
How do I do this.
I know one way. Develop C routine in Oracle Apps to call external java class and call this C routine from the PL/SQL.
Is there any simple method available? or any other method?
Thanks in advance.
-VenkatFirst of all, this is a Java application you're talking about, right (i.e. it has a main() function)? It's not just a class that you're trying to instantiate is it? If it's an application, you obviously have to start a new virtual machine to run it (rather than using the virtual machine built into the database like stored java). I'm a little leary of your mention of an "application server" as this would more commonly mean that a virtual machine is already over there running with access to this class. In which case, you'd typically interface with SOAP or some other RPC API.
All that aside, as long as you have physical disc access (through NFS or whatever) to the class file, you could use a java wrapper class with a system call to do this. In fact, there is a thread in just the last day or so on this very forum that has the code to do just that (see " Invoking OS Commands from PL/SQL"). However, it's worth noting that the virtual machine will be running on the database server in this case and not the application server. -
How to call a bean method from javascript event
Hi,
I could not find material on how to call a bean method from javascript, any help would be appreciated.
RalphHi,
Basically, I would like to call a method that I have written in the page java bean, or in the session bean, or application bean, or an external bean, from the javascript events (mouseover, on click, etc...) of a ui jsf component. I.e., I would like to take an action when a user clicks in a column in a datatable.
Cheers,
Ralph -
Call an ABAP routine from Web Template
Hi Gurus,
I Need to call an ABAP routine from a Web template or export value to memory to use in the variable exit.
is it possible ?
Thanks.
RodrigoHi Ankit,
take a look:
/thread/725385 [original link is broken]
WAD and ABAP
How to call a ABAP or ABAP Class from the WEB
/people/kai.wachter/blog/2008/03/11/how-to-write-own-items-in-bi-70-java-runtime
Regards
Andreas
Maybe you are looking for
-
Hi Guru's Can anybody tell me the real meaning of releasing a request In basic terms with examples.. waiting very eagerly for your replies
-
TUTORIAL: How to make PPC Plug-Ins work on Intel Macs!
Hi guys, I wanted to share this brillant method with you all, collect ideas and create a list of Plug-Ins, you have succeeded to make work (I guess nearly all PPc Plugs will work this way but lets better stick to facts). Maybe there is a way to work
-
J1id - Vendor excise details issue
Hi All, When I create record in J1ID, for vendor excise. the "change on" fields should be auto populate, but this is not happening. This field doesnu2019t change automatically. I have to do manually. How can i change this, I need when i change record
-
Hello The Jobwork Process is Handled by Production and Inventory Transfer Documemt. 1. Purchase Raw Material From Supplier and receive it to your Premises 2 .inventory Transfer it to Jobwork warehouse like send for Jobwork and Print the Form 57F4Chal
-
How do I save a contact sheet?
How do I make and save a contact sheet as I don't print at home so need to save it not print it? I have Elements 5, just ordered Elements 7 (havent even recieved it yet) and now 8 has been released (don't you hate that!). Help will be appreciated!