Error in using external procedure in PL/SQL Block
After setting up the configuration : Respective entries in
tnsnames.ora
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
(CONNECT_DATA = (SID = PLSExtProc)(SERVER=DEDICATED))
and listner.ora :
(SID_LIST = (SID_DESC = (GLOBAL_DBNAME = mymachine )(SID_NAME = mysid)) (SID_DESC = (GLOBAL_DBNAME = mymachine )(SID_NAME = myid1))
(SID_DESC = (GLOBAL_DBNAME = mymachine )(SID_NAME = myid2))
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle9i)
(PROGRAM = extproc)
(ENVS="EXTPROC_DLLS = ANY" // Added this entry
(SID_DESC =
(GLOBAL_DBNAME = oracle9i)
(ORACLE_HOME = /oracle9i)
(SID_NAME = oracle9i)
(ENVS="EXTPROC_DLLS= ANY") // Added this entry
Wrote the program as :
===========================================================
#include <stdio.h>
#include<stdlib.h>
void sh(char *command) {
int num;
num = system(command);
===========================================================
Compiled the file (above ) shell.c as :
gcc -c shell.c
Made the library as :
ld -r -o shell.so shell.o
chmod 777shell.so
copied the file to respective Home directories. Made one link to /usr/lib :
which is in LD_LIBRARY_PATH
created the Library as :
CREATE OR REPLACE PROCEDURE shell(command IN char)
AS EXTERNAL
NAME "sh"
LIBRARY shell_lib
LANGUAGE C
PARAMETERS (command string);
So my problem is
when executing the procedure from SQL prompt:
SQL> exec shell('any command');
it throws the following errors :
BEGIN shell('ls'); END;
ERROR at line 1:
ORA-06520: PL/SQL: Error loading external library
ORA-06522: /opt/sotas/bin/shell.so: only ET_DYN and ET_EXEC can be loaded
ORA-06512: at "CDR_ADMIN.SHELL", line 0
ORA-06512: at line 1
Any help or suggestions would be appreciated
Thanks in advance......
Made one Link to /usr/lib
Nikolai,
I have created a simple process flow which only calls the external process. The script is on the same host as the process flow is deployed to.
I have used two diffent values for the command parameter.
1. I placed the full path of the file in the command parameter and left the script parameter blank:
COMMAND: /edwftp/ppas/scripts/ClearPPAS.sh
PARAMETER_LIST:
SUCCESS_THRESHOLD: 0
SCRIPT:
2.I placed the bash command in the command parameter and the full path in the script parameter.
COMMAND: /usr/bin/sh
PARAMETER_LIST:
SUCCESS_THRESHOLD: 0
SCRIPT: /edwftp/ppas/scripts/ClearPPAS.sh
Both of these appear to work as they print out the statements inside the script but the files that are supposed to be removed still remain.
Starting Execution EXTER_FILE
Starting Task EXTER_FILE
Starting Task EXTER_FILE:EXTERNALPROCESS
Removing ActivatedAudit.dat...
Removing ActivatedCustomers.dat...
Removing ActiveAudit.dat...
Removing ActiveCustomers.dat...
Done!
Create the Activated Customers data file...
Create the Active Customers data file...
Done!
WARNING: Log file truncated - see RAB for further information.
/edwftp/ppas/scripts/ActivatedCustomers.sh: /edwftp/ppas/log/ActivatedCustomers.log: cannot create
/edwftp/ppas/scripts/ActiveCustomers.sh: /edwftp/ppas/log/ActiveCustomers.log: cannot create
WARNING: Log file truncated - see RAB for further information.
Completing Task EXTER_FILE:EXTERNALPROCESS
Completing Task EXTER_FILE
Completing Execution EXTER_FILE
The permissions on the /log direcotry are 775. The user I register the file location with owns this directory.
Can't think of anything else I have missed. I really appreciate your help :)
Ryan
Similar Messages
-
How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000
Post Author: ltkin
CA Forum: WebIntelligence Reporting
Hi,
How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000 ?
Regards,Hi ltkin,
Unfortunately, it is not possible in Xir2 to create Webi reports from stored procedures.
Webi reports can only be created from Universe. So in Business Objects XIR3 we can create a special universe that enables Web Intelligence user's to access stored procedures residing in the database. This is the only way that Web Intelligence user's can access stored procedures.
Please let me know if the above information helps.
Regards,
Pavan -
How to Use the Procedures in a Sql Query
Hi Friends,
Can anyone help me out whether can we use the procedure in the sql query..
if yes help me out with an example
my requirement is
i have one sql query .. in which i need to use the procedure which returns multiple values... how can i overcome it,can anyone help me out for this..
for your reference i am pasting the sql query
SELECT paf.person_id
FROM per_all_assignments_f paf START WITH paf.person_id = p_person_id
AND paf.primary_flag = 'Y'
AND paf.assignment_type IN('E', 'C')
AND l_effective_date BETWEEN paf.effective_start_date
AND paf.effective_end_date
CONNECT BY PRIOR paf.supervisor_id = paf.person_id
AND paf.primary_flag = 'Y'
AND paf.assignment_type IN('E', 'C')
AND l_effective_date BETWEEN paf.effective_start_date
AND paf.effective_end_date
and paf.person_id not in (>>>I HAVE TO USE THE PROCEDURE HERE<<<<);
Thanks in advanceWe never saw your procedure, but maybe you could wrap it in a function
SQL> create or replace procedure get_members(in_something IN number, out_members OUT sys_refcursor)
is
begin
open out_members for
'select level member_id from dual connect by level <= :num' using in_something;
end get_members;
Procedure created.
SQL> create or replace type numbers as table of number;
Type created.
SQL> create or replace function members(in_something IN number)
return numbers
as
member_cur sys_refcursor;
members numbers;
begin
get_members(in_something, member_cur);
fetch member_cur bulk collect into members;
close member_cur;
return members;
end;
Function created.
SQL> select * from table(members(4));
COLUMN_VALUE
1
2
3
4
4 rows selected.Variant on same using piplined function
SQL> create or replace function members_piped(in_something IN number)
return numbers pipelined
as
member_cur sys_refcursor;
rec number;
begin
get_members(in_something, member_cur);
loop
fetch member_cur into rec;
exit when member_cur%notfound;
pipe row(rec);
end loop;
close member_cur;
return;
end;
Function created.
SQL> select * from table(members_piped(4));
COLUMN_VALUE
1
2
3
4
4 rows selected.
SQL> drop function members_piped;
Function dropped.
SQL> drop function members;
Function dropped.
SQL> drop type numbers;
Type dropped.
SQL> drop procedure get_members;
Procedure droppedEdit:
Sorry Blu, had not seen you already posted similar thing
Edited by: Peter on Jan 27, 2011 5:38 AM -
Stored Procedure Vs PL-SQL Block
Hi,
I came across an interesting problem last week. Fortunately, I was able to solve it or find an acceptable workaround for myself. But wanted to get some clarification from the experts. So posting it here.
Also, I am new to Orcle, so please excuse any shortcomings in the post.
My data model has following tables-
TABLE_PARENT (ID, other columns)
TABLE_CHILD (ID, other columns, PARENT_ID_FK)
Here, ID is the primary key column for the respective tables; PARENT_ID_FK is the foreign key referencing the ID column from the TABLE_PARENT.
I created a stored procedure programmatically (using MS Excel) to insert records in the two tables. The stored procedure has insert statements for an indefinite number of records in the parent table and for every such record, there's a corresponding record inserted in the child table. Here's the sample code.
BEGIN
/*first record*/
parent_id := MY_SEQUENCE_GENERATOR.NEXTVAL;
INSERT INTO TABLE_PARENT(ID, other columns) VALUES (parent_id, other values);
INSERT INTO TABLE_CHILD(ID, other values,parent_id );
/*second record*/
parent_id := MY_SEQUENCE_GENERATOR.NEXTVAL;
INSERT INTO TABLE_PARENT(ID, other columns) VALUES (parent_id, other values);
INSERT INTO TABLE_CHILD(ID, other values,parent_id );
/*third record*/
parent_id := MY_SEQUENCE_GENERATOR.NEXTVAL;
INSERT INTO TABLE_PARENT(ID, other columns) VALUES (parent_id, other values);
INSERT INTO TABLE_CHILD(ID, other values,parent_id );
/*and so on*/
END
When I run this stored procedure, I keep getting following exception intermittently-
ORA-02291: integrity constraint violated-parent key not found tips.
My thinking is that it comes because the insert statements are executing ahead of turn of the parent_id assignment statement. And this is happening possibly because of some parallelism that is taking place during the execution of the stored procedure, or, some sort of optmization that the DB server does (though erroneously) when it compiles the stored procedure.
I tried out everything that I could think of but it didn't go away. Finally, when I executed the same set of statements as a PL-SQL block, it worked fine.
To understand it better, I am looking for clarification on the following questions.
1) Why does the exception come with stored procedure but not with PL-SQL block? Is my reasoning given above correct (parallelism or some sort of optimization coming into play)?
2) If it is due to parallelism, how to run a Oracle stored procedure with defree of prallelism set to 1?
3) If it is due to optimization done by the compiler, how to instruct the compiler to not do any such optimization. Also, in any case, isn't it an error to optimize but lose program semantics?
4) Another question related to the same piece of work I have is to use transactions in the PL-SQL block, I had to explicitly COMMIT/ROLLBACK it in the code. In whatever references I had read, it was said that by default the transaction begins with BEGIN statement and commits with END. Also, it seems to work with a Stored Proedure though. So is it that a PL_SQL block needs explicity call to COMMIT/ROLLBACK to achive transactions but stored procedures do not?
Any inputs/clarifications will be much appreciated.
Thank you
NeeleshOk, your last couple of paragraphs were helpful. Here're the details that were missing in my earlier post.
- I am on Oracle 10.2.0.
- Table definitions-
CREATE TABLE "MYUSER"."TABLE_PARENT"
*( "ID" NUMBER(19,0) NOT NULL ENABLE,*
* "NAME" VARCHAR2(30),*
* "DESCRIPTION" VARCHAR2(80),*
* "RULETYPE" NUMBER(10,0) NOT NULL ENABLE,*
* "OPERATOR" NUMBER(10,0),*
* "MININTERCEPT" FLOAT(126),*
* "PRIORITY" NUMBER(10,0),*
* "PENALTY" NUMBER(10,0),*
* "STATUS" NUMBER(10,0),*
* PRIMARY KEY ("ID")*
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS" ENABLE,
*) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING*
STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS"
CREATE TABLE "MYUSER"."TABLE_CHILD"
*( "ID" NUMBER(19,0) NOT NULL ENABLE,*
* "WEIGHT" NUMBER(19,0),*
* "PARENTID_FK" NUMBER(19,0),*
* PRIMARY KEY ("ID")*
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS" ENABLE,
* CONSTRAINT "FK3A78BF1E6A9DCE51" FOREIGN KEY ("PARENTID_FK")*
* REFERENCES "MYUSER"."TABLE_PARENT" ("ID") ENABLE*
*) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING*
STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS"
- The Stored procedure definition is-
CREATE OR REPLACE PROCEDURE LOAD_RULES_SP AS
ruleid NUMBER(19,0);
tempid NUMBER(19,0);
BEGIN
*/* First parent record */*
SELECT IDGENERATOR.NEXTVAL INTO ruleid FROM dual;
INSERT INTO TABLE_PARENT (ID, NAME, DESCRIPTION, RULETYPE, OPERATOR, MININTERCEPT, PRIORITY, penalty, STATUS) VALUES (ruleid, 'Rule 1',null,3,0,0,null,null,1);
*/* Corresponding child records */*
SELECT IDGENERATOR.NEXTVAL INTO tempid FROM dual;
INSERT INTO TABLE_CHILD (id, weight, PARENTID_FK)
VALUES (tempid, 0.2, ruleid);
SELECT IDGENERATOR.NEXTVAL INTO tempid FROM dual;
INSERT INTO TABLE_CHILD (id, weight, PARENTID_FK)
VALUES (tempid, 0.5, ruleid);
SELECT IDGENERATOR.NEXTVAL INTO tempid FROM dual;
INSERT INTO TABLE_CHILD (id, weight, PARENTID_FK)
VALUES (tempid, 0.3, ruleid);
*/* First parent record */*
SELECT IDGENERATOR.NEXTVAL INTO ruleid FROM dual;
INSERT INTO TABLE_PARENT (ID, NAME, DESCRIPTION, RULETYPE, OPERATOR, MININTERCEPT, PRIORITY, penalty, STATUS) VALUES (ruleid, 'Rule 1',null,3,0,0,null,null,1);
*/* Corresponding child records */*
SELECT IDGENERATOR.NEXTVAL INTO tempid FROM dual;
INSERT INTO TABLE_CHILD (id, weight, PARENTID_FK)
VALUES (tempid, 0.2, ruleid);
SELECT IDGENERATOR.NEXTVAL INTO tempid FROM dual;
INSERT INTO TABLE_CHILD (id, weight, PARENTID_FK)
VALUES (tempid, 0.5, ruleid);
SELECT IDGENERATOR.NEXTVAL INTO tempid FROM dual;
INSERT INTO TABLE_CHILD (id, weight, PARENTID_FK)
VALUES (tempid, 0.3, ruleid);
*/* And so on for a few parent records more */*
END;
Can you throw some light on the exception I was seeing now? Note that when I changed from stored procedure to an anonymous block, it worked fine.
One correction in my earlier post is that as the code snippet shows, there are multiple inserts in the child table for every record inserted in the parent one. -
Need to refresh materialized view from procedure and pl/sql block
Hi,
I need to refresh materialized view (complete refresh)from procedure and pl/sql block .can some one help.
MV name:MV_DGN_TEST_SESSION
Thanks,
Rajasekhardbms_mview.REFRESH ('MV_DGN_TEST_SESSION', 'C');Regards,
Mahesh Kaila
Edited by: user4211491 on Dec 1, 2009 10:41 PM -
Error using EXTERNAL PROCEDURES on UNIX
I'm having troubles to run external procedures on UNIX. I'm following the extern.c example that comes by default. It works very well on my NT enviornment, but not on Unix.
I compiled the share library on my solaris OS, and then I create the library, procedures,etc.
But when I try to run the procedure I received the following error:
ERROR at line 1:
ORA-06520: PL/SQL: Error loading external library
ORA-06522: ld.so.1: extprocextproc: fatal: libucb.so.1: open failed: No such
file or directory
ORA-06512: at "SAMPLE.PLS_MAX", line 0
ORA-06512: at "SAMPLE.USEIT", line 8
ORA-06512: at line 1I'm having troubles to run external procedures on UNIX. I'm following the libtest1.c example that comes by default. It works very well on my NT enviornment, but not on Unix.
I compiled the share library on my solaris OS, and then I create the library, procedures,etc.
But when I try to run the procedure I received the following error:
ERROR at line 1:
ORA-06520: PL/SQL: Error loading external library
ORA-06522: Unresolved external
ORA-06512: at "YDBROW.ORA_TEST", line 0
ORA-06512: at line 8 -
Error while using External Table
Hi Guru's,
I am using external tables in my procedure and the code to create it will be dynamically built inside the procedure itself. I have tested it so many times and it works fine only. But suddenly now it is throwing some error and i was not able to figure out the problem.
Additional Info:
1. I have provided the full rights to the input directory.
2. Working in Oracle 10g release 2
3. Unix OS in server
4. Error description:
<< UK_TRADINGDATA_LOAD >> ABEND : <<ABEND SYS-000 >> uncatched ORACLE-error : ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file EXTRACTION COMPLETED in EXT_UK_TRADINGDATA not found
v_ac_sql:='CREATE TABLE VLDPROCESS'||gv_ac_schema_suffix||'.EXT_UK_TRAD_'||gv_ac_machineid ||'_'||gv_ac_retailer_id||'_ADHOC'||CHR(10)
||'( AC_RETAILER_ID VARCHAR2(2 BYTE),'||CHR(10)
||'AC_DEPARTMENT_CD VARCHAR2(20 BYTE),'||CHR(10)
||'NC_PERIOD_FROM NUMBER,'||CHR(10)
||'NC_PERIOD_TO NUMBER'||CHR(10)
||')'||CHR(10)
||'ORGANIZATION EXTERNAL'||CHR(10)
||'(TYPE ORACLE_LOADER'||CHR(10)
||'DEFAULT DIRECTORY EXT_UK_TRADINGDATA'||CHR(10)
||'ACCESS PARAMETERS'||CHR(10)
||'(RECORDS DELIMITED BY NEWLINE'||CHR(10)
||'badfile '''||v_ac_failed_files||'.bad'''||CHR(10)
||'discardfile '''||v_ac_failed_files||'.dis'''||CHR(10)
||'logfile '''||v_ac_failed_files||'.log'''||CHR(10)
||'FIELDS'||CHR(10)
||'('||CHR(10)
||'AC_RETAILER_ID position( 1: 2) char( 2),'||CHR(10)
||'AC_DEPARTMENT_CD position( 3:22) char(20),'||CHR(10)
||'NC_PERIOD_FROM position(23:29) char( 7),'||CHR(10)
||'NC_PERIOD_TO position(30:36) char( 7)'||CHR(10)
||')'||CHR(10)
||')'||CHR(10)
||'LOCATION ('''||v_ac_file_name ||''')'||CHR(10)
||')'||CHR(10)
||'REJECT LIMIT 100'||CHR(10)
||'NOPARALLEL'||CHR(10)
||'NOMONITORING';
EXECUTE IMMEDIATE v_ac_sql; Kindly help me!
With Regards,
VJSometimes when troubleshooting issues like this it is helpful to output the dynamic SQL generated to the screen or spool it to a text file. From there it's usually easy to determine where the problem lies.
If you can provide that one of the forum members can figure it out. -
Error Calling an external procedure
I'm calling an external procedure (provided by a third party).
When i invoke it from a client code, it functions.
When I invoke it from PL/SQL code, it gives the following error:
ORA-28576: lost RPC connection to external procedure agent.
The solution in the help file states it could be a timeout problem.
If so, what is the solution to the problem. (I cannot access the source of the DLL subroutine).your listener.ora file has problem!
it should look similiar to:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = elvis)(PORT = 1521))
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = <substitute with your oracle home>)
(PROGRAM = extproc)
(SID_DESC =
(GLOBAL_DBNAME = elvis)
(ORACLE_HOME = <substitute_with_your_oralce_home>)
(SID_NAME = elvis)
please verify with net8 admin guide. you also need to set up tnsnames.ora correctly at client side.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Benjamin Sigursteinsson ([email protected]):
I'm having a problem calling an external procedure running on Linux. The setup works using NT and a DLL, but when the function has been converted to a .so library, I get get
ORA-28575: unable to open RPC connection to external procedure agent
Now this is probaly due to my listener config since when starting the listener I get an IPC error:
Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=elvis))
TNS-12224: TNS:no listener
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (ADDRESS=(PROTOCOL=TCP)(Host=elvis)(Port=1521))
STATUS of the LISTENER<HR></BLOCKQUOTE>
null -
Error while executing a procedure in pl/sql
Hi,
iam execvuting a procedure in pl/sql and i get the following error,
proc Running: Wed Sep 7 06:13:20 IST 2005
Table truncated.
BEGIN <procedure_name> ; END;
ERROR at line 1:
ORA-01555: snapshot too old: rollback segment number 75 with name "RBS74" too
small
ORA-06512: at "<procedure_name>", line 104
ORA-06512: at line 1
could anyone explain what has gone wrong in this case???According to the documentation:
ORA-01555: snapshot too old: rollback segment number string with name "string" too small
Cause: Rollback records needed by a reader for consistent read are overwritten by other writers.
Action: If in Automatic Undo Management mode, increase the setting of UNDO_RETENTION. Otherwise, use larger rollback segments.
Error: ORA-01555: snapshot too old (rollback segment too small)
Cause: This error can be caused by one of the problems, as described below.
Action: The options to resolve this Oracle error are:
This error can be the result of there being insufficient rollback segments.
A query may not be able to create the snapshot because the rollback data is not available. This can happen when there are many transactions that are modifying data, and performing commits and rollbacks. Rollback data is overwritten when the rollback segments are too small for the size and number of changes that are being performed.
To correct this problem, make more larger rollback segments available. Your rollback data for completed transactions will be kept longer.
This error can be the result of programs not closing cursors after repeated FETCH and UPDATE statements.
To correct this problem, make sure that you are closing cursors when you no longer require them.
This error can occur if a FETCH is executed after a COMMIT is issued.
The number of rollback records created since the last CLOSE of your cursor will fill the rollback segments and you will begin overwriting earlier records. -
Getting Error while using UTL_MAIL procedure
Hi All,
I have written a simple PL/SQL block in which I call the UTL_MAIL.SEND procedure:
DECLARE
vSender varchar2(100);
vReceiver varchar2(100);
vSubj varchar2(100);
vMesg varchar2(100);
vMType varchar2(100);
BEGIN
vSender := '[email protected]';
vReceiver := '[email protected]';
vSubj := 'Test Email';
vMesg := 'This is a test email';
vMtype := 'text/plain; charset=us-ascii';
utl_mail.send(vSender, vReceiver, NULL, NULL, vSubj,vMesg, vMType, NULL);
END;
When I execute the code, I get the following error message:
ORA-29261: bad argument
ORA-06512: at "SYS.UTL_TCP", line 17
ORA-06512: at "SYS.UTL_TCP", line 246
ORA-06512: at "SYS.UTL_SMTP", line 115
ORA-06512: at "SYS.UTL_SMTP", line 138
ORA-06512: at "SYS.UTL_MAIL", line 386
ORA-06512: at "SYS.UTL_MAIL", line 599
ORA-06512: at line 15
29261. 00000 - "bad argument"
*Cause: A bad argument was passed to the PL/SQL API.
*Action: Check the arguments passed to the PL/SQL API and retry the call.
Could anyone tell me where I am going wrong?
Regards,
AJuser11256160 wrote:
Could anyone tell me where I am going wrong?Code is fine. Parameter defining the SMTP server is missing.
You need to define it (using a SYSDBA account) as follows:
SQL> alter system set smtp_out_server='<your-smtp-server>' scope=both;Replace +<your-smtp-server>+ with the IP address or host name of your SMTP server. Also this assumes standard SMTP tcp/25 port is used. If not, add the port number (using a colon separator) to the server name. -
Rpc error calling an external procedure
I'm having a problem calling an external procedure running on Linux. The setup works using NT and a DLL, but when the function has been converted to a .so library, I get get
ORA-28575: unable to open RPC connection to external procedure agent
Now this is probaly due to my listener config since when starting the listener I get an IPC error:
Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=elvis))
TNS-12224: TNS:no listener
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (ADDRESS=(PROTOCOL=TCP)(Host=elvis)(Port=1521))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 8.0.5.0.0 - Production
Start Date 20-NOV-00 18:06:42
Uptime 0 days 0 hr. 0 min. 6 sec
Trace Level admin
Security OFF
SNMP OFF
Listener Parameter File /home/oracle/ora01/app/oracle/8.0.5/network/admin/listener.ora
Listener Log File /home/oracle/ora01/app/oracle/8.0.5/network/log/listener.log
Listener Trace File /home/oracle/ora01/app/oracle/8.0.5/network/trace/listener.trc
Services Summary...
elvis has 1 service handler(s)
extproc has 1 service handler(s)
The command completed successfully
I'm using Oracle 8.0.5 and RedHat 6.0. The name of machine is elvis and the sid name is elvis as well. Any bright ideas are more than welcome
Benyour listener.ora file has problem!
it should look similiar to:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = elvis)(PORT = 1521))
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = <substitute with your oracle home>)
(PROGRAM = extproc)
(SID_DESC =
(GLOBAL_DBNAME = elvis)
(ORACLE_HOME = <substitute_with_your_oralce_home>)
(SID_NAME = elvis)
please verify with net8 admin guide. you also need to set up tnsnames.ora correctly at client side.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Benjamin Sigursteinsson ([email protected]):
I'm having a problem calling an external procedure running on Linux. The setup works using NT and a DLL, but when the function has been converted to a .so library, I get get
ORA-28575: unable to open RPC connection to external procedure agent
Now this is probaly due to my listener config since when starting the listener I get an IPC error:
Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=elvis))
TNS-12224: TNS:no listener
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (ADDRESS=(PROTOCOL=TCP)(Host=elvis)(Port=1521))
STATUS of the LISTENER<HR></BLOCKQUOTE>
null -
Error in using External Process in the Process Flow
I Created a Process Flow with an external process to Move the file from one location to another location,
I gave the below parameters for the External Process
COMMAND: move
PARAMETER_LIST: ?F:\\FlatFiles\\in\\company.txt?F:\\FlatFiles\\error\\company.err
SUCCESS_THRESHOLD: 0
SCRIPT:
The environment is
Windows 2003
OWB 9.2.0.8
OWF Builder 2.6
When I deploy and execute using Deployment Manager, it gave me the below error
Starting Execution TEST
Starting Task TEST
Starting Task TEST:EXTERNALPROCESS
CreateProcess: move move F:\FlatFiles\in\company.txt F:\FlatFiles\error\company.err error=2
Completing Task TEST:EXTERNALPROCESS
Completing Task TEST
Completing Execution TEST
What am I missing something here?
Is my Parameters correct?
GIve me the link where I can find more on using External process.
Please...please...help me..
ShreeNikolai,
I have created a simple process flow which only calls the external process. The script is on the same host as the process flow is deployed to.
I have used two diffent values for the command parameter.
1. I placed the full path of the file in the command parameter and left the script parameter blank:
COMMAND: /edwftp/ppas/scripts/ClearPPAS.sh
PARAMETER_LIST:
SUCCESS_THRESHOLD: 0
SCRIPT:
2.I placed the bash command in the command parameter and the full path in the script parameter.
COMMAND: /usr/bin/sh
PARAMETER_LIST:
SUCCESS_THRESHOLD: 0
SCRIPT: /edwftp/ppas/scripts/ClearPPAS.sh
Both of these appear to work as they print out the statements inside the script but the files that are supposed to be removed still remain.
Starting Execution EXTER_FILE
Starting Task EXTER_FILE
Starting Task EXTER_FILE:EXTERNALPROCESS
Removing ActivatedAudit.dat...
Removing ActivatedCustomers.dat...
Removing ActiveAudit.dat...
Removing ActiveCustomers.dat...
Done!
Create the Activated Customers data file...
Create the Active Customers data file...
Done!
WARNING: Log file truncated - see RAB for further information.
/edwftp/ppas/scripts/ActivatedCustomers.sh: /edwftp/ppas/log/ActivatedCustomers.log: cannot create
/edwftp/ppas/scripts/ActiveCustomers.sh: /edwftp/ppas/log/ActiveCustomers.log: cannot create
WARNING: Log file truncated - see RAB for further information.
Completing Task EXTER_FILE:EXTERNALPROCESS
Completing Task EXTER_FILE
Completing Execution EXTER_FILE
The permissions on the /log direcotry are 775. The user I register the file location with owns this directory.
Can't think of anything else I have missed. I really appreciate your help :)
Ryan -
Simple PL/SQL Question - Creating/using a procedure in PL/SQL
So far, I have been making simple PL/SQL scripts with no procedures. The structure looks like the following:
DECLARE
BEGIN
END
I have found documentation for Procedures, however I don't see how to insert them into that structure. Apparently one way is Packages, however I don't want to store the PL/SQL on the database. Can someone give me a highlevel structure of a PL/SQL that defines and uses a procedure?SQL> declare
2 procedure stage1 as
3 begin
4 dbms_output.put_line('stage 1');
5 end;
6 procedure stage2 as
7 begin
8 dbms_output.put_line('stage 2');
9 end;
10 begin
11 stage1;
12 stage2;
13 end;
14 /
stage 1
stage 2
PL/SQL procedure successfully completed.
SQL> -
How to use external procedures in OWB Mapping
Hi,
Does anyone have an exmple of using external procdures in Mapping.
Thanks
mandiHi Mandi,
you can use Public and self created external Procedures/Functions in a Mapping.
You can integrate them in Expressions, e.g.
or use them as Post or Premapping in a Mapping.
It´s simple, just play a bit :-)
Only on a few Things you´ve to watch:
Every external Objects you want to use in a Mapping must be known in the Metadatas.
If you create a Mapping under the User scott,(e.g.), and you want to use
an external Procedures/Functions from the User Tiger,(e.g.), you must make sure
that theres a connection between these two Schematas.
For such things you can create a Connector in the Control Center.
Regards
Lone -
JDBC - CallableStatement - Error in Accessing Stored Procedure of MS SQL
Dear Friends,
The following is the code to access a stored procedure of MS SQL Server 7.0 sp4,
try
CallableStatement cstmt;
ResultSet rst;
cstmt = connection.prepareCall("{call backupdb[?,?]}");
cstmt.setString("db_name","SBIREMITLIVE");
cstmt.setString("path", "c:\testing.bak");
cstmt.executeQuery();
System.out.println("Stored Procedure called successfully");
catch(SQLException se)
System.out.println(se.toString());
when i execute this i am getting the error as " MS ODBC-MS SQL Server Syntax error or Access Violation "
What's the problem exactly ? anybody came across this issue..if so...kindly help me....
Here is my MS SQL Server stored procedure.....for reference
create procedure backupdb(@db_name varchar(40), @path varchar(100)) as
Backup database @db_name to disk = @path
Regards,
V.PrasannaDear DigitalDreamer,
Yes, as per your suggestion, it's working fine...thanks a lot...
here is the code...
CallableStatement cstmt;
ResultSet rst;
cstmt = connection.prepareCall(" exec backupdb ?,? ");
cstmt.setString(1,"SBIREMITLIVE");
cstmt.setString(2, "c:\\testing.bak");
cstmt.execute();
Regards,
V.Prasanna
Maybe you are looking for
-
Hyperlinks don't work once site is published
I have set up some text hyperlinks in my site - www.fullabullies.com. If you go to the site, you'll see on the home page the purple star that says "puppies". this should bring you to the "litters" page. I also have the red star that says "akc bulldog
-
Sticky load balancing not working because of Address Translation
This came up before - see below. I don't understand what the soltion is/was. WL Server puts it's ip address in the WebLogicSession cookie which is an internal address 192.168.201.41 WL proxy knows WL
-
SUM( ) versus Aggregation SUM
When creating a new logical column for a fact table, I can define it with an expression like SUM (column A - columnB) with aggregation rule None - column A and B being pointed to physical columns. On the other hand I can use an expression (column A -
-
I downloaded lion yesterday now safari is giving me problems. Safari is not allowing me to quit. When I go to click on "Quit Safari" it is not in bold thus i am not able to close the application or even shut down my Mac. Plz help.
-
Version 5 does not recognize the Windows 7 OS?
upgraded to version 5 and now a site/plugin that I use will not recognize the operating system as Windows 7. the plugin worked correctly from v4.01..