Problems calling a procedure
Hello to all,
I'm having some problens calling a procedure because i'm omiting the Schema value on porpuse.
this procedure will be executed on several databases, so I do not whant do force the schema and want to let the CONTEXT do it's work ... :-(
on the Target I've chose the Oracle technology and have a simple invocation line code:
begin
hospital1.pkg_test.test_proc('20080901','20080930',1);
end;
but he is giving me following error message:
java.lang.Exception: Internal error: object ConnectConnection
ColConnectId:null
ColContextCode:HOSPITAL1
ColConName:null
ColIndCommit:null
ColIsolLevel:null
ColLschemaName:null <<<<<<<<<<<<<< NULL ??? should not the CONTEXT inicialize this variable?
ColPlanComp:null
ColTechIntName:ORACLE
DefConnectId:null
DefContextCode:HOSPITAL1
DefConName:null
DefIndCommit:null
DefIsolLevel:null
DefLschemaName:null
DefPlanComp:null
DefTechIntName:ORACLE
ExeChannel:J
IndErr:0
IndLogMethod:null
IndLogNb:null
LogLevDet:3
Nno:1
OrdTrt:0
ScenTaskNo:1
SessNo:1361020
TaskName1:Procedure
TaskName2:Extract por package com parametros
TaskName3:extract_local
TaskType:S
The context HOSPITAL1 has a correct logical and physical information ...
As a workarround, can I call the procedure on a command line or in a interface?
Thanks,
Pedro
Hi,
please simply call the procedure which you created on the schema through the ODI procedure .
AS you told that you have to call this procedure on different schema then In order to do so you had to create different data server in topology managaer & their GLOBAL context & different schemas name .
While exectuing the procedure in ODI please select Schemas or data server on which you wnat to execute.
please create no of commands for different dataserver.
for example ;;;
BEGIN
PROC_PARTSGROUPLANG();
PROC_PARTSLANG();
END;
PROC_PARTSGROUPLANG() & PROC_PARTSLANG(); are tro procedures which i had called in the ODI.
I think you are passing HOSPITAL1 as connection name or user name . So please dont pass it & simply call the procedure.
for eg
BEGIN
Pkg_test.Proc1('1','neeraj')
END;
Thanks
Neeraj
Edited by: neeraj_singh on Nov 24, 2008 10:38 PM
Similar Messages
-
Weird Problem calling Stored Procedure using JDBC
Scenario is..
I have J2EE application and calling stored procedure using JDBC.
My application connects to instance "A" of testDB.
Schema "A" does NOT own any packages/procedure but granted execute on oracle packages/procedures that reside in schema "B" of testDB.
In java code I call procedure(proc1) in package(pac1) which internally calls procedure(proc2) in package(pac2).
The problem occurs when procedure pac2.proc2 is modified. After the modification, my java code fails and throws an exception "User-Defined Exception" and I am also getting "ORA-06508: PL/SQL: could not find program unit being called". This clears up only if I bounce the web container. (This doesn't happen if I modify pac1.proc1 and run my application)
Has any one faced this problem? Please suggest if any thing can be changed in jdbc code to fix this problem.
ThanksHi,
I assume these are PL/SQL packages and that the changes are made at the package specification level?
If so, it looks like you are hitting the PL/SQL dependencies rules. In other words, if the spec of proc2 is changed, then proc1 is invalidated, since proc1 still depends on the old version of proc2's spec. As a result, if you try to run proc1, its spec must either be explicitly rewritten before it could run again or implicitly recompiled first, if the (implicit) recompilation fails, it won’t run.
Kuassi http://db360.blogspot.com -
PLSQL portlet - problem calling stored procedure -
Good day folks. My portal version 10.1.2. I have a dynamic page with multiple rows. For simplicity, example here has two columns => id and value. The initial dilemma - The stored procedure specified in the action attribute of the <form> tag has to have parameters that match in name and count to the fields on the html form. But, the number of rows is variable on the form. I currently use pl/sql to generate the page. I have two forms in the html - form A has two static fields id and value, with an action attribute of the stored procedure I want to run. The second html form is form B. It has id_1, value_1, id_2, value_2, id_3, value_3 and so on with a variable number of rows. SO, when the user clicks the "Submit" button at the bnottom of the page, I call a javascript passing in the number of rows. I then loop through the Form B, and for each row of data, I do a submit of Form A. My goal is to run the stored procedure in the database for each row of data in Form B. I use Form A to accomodate the requirement that the stored procedure has to match in name and number the parameters inthe form.
This is to avoid an update button on each row of data, also.
The problem - in my javascript, I set the values of Form A to the values from Form B correctly. However, only the last rowis successful in running the procedure. For example, if I have 3 rows in Form B, I want to submit form A 3 times, but, it only seems to submit once for row #3. The weird thing is if I put an alert message after the document.formA.submit(); command, the stored procedure is successfully called for each row in form B, but when I remove the alert, only the last row successfully calls the procedure!
Thanks in advance if anybody has any ideas -
KentLet's continue the example of 3 rows.
It sounds like that you submit the form 3 times in quick succession, and so before the Action for Form A has had time to run and respond for the first row, the second row has been submitted, and therefore the web page will stop trying to display the results from the submit of Row 1 (by this I mean it'll stop the http request, if you do this quick enough then the back-end function won't run). Then the same thing happens to Row 2's submit when Row 3 starts.
What it sounds like you need to do is to use only 2 parameters, but repeat them on the HTML page, when the submit is run it's passed to oracle as a type 'owa_util.vc_arr'. There is a more comprehensive solution to this problem in another thread:
passing variable number of arguments in a stored procedure
Please note though that you have to be careful of the situations where your form only has one row to submit to the oracle function, in this case the data type of the parameter will be a VARCHAR2 rather than a owa_util.vc_arr. The solution to this problem is to always have a an extra dummy parameter which is empty and you skip over it during your processing. (Thought I'd better include this information in case you ran into this problem).
Hope this helps.
Cheers,
Ron. -
Problem call stored procedure from asp using oo4o
I am having a problem calling a pl/sql stored procedure from ASP.
Attached is the code. Any help would be appreciated. There are no errors returned on the page as far as I can tell.
Sub add_cc_rec(p_location_rental_object_num, p_start_date, p_end_date, p_rate_code, p_quantity)
'On Error Resume Next
Dim msg, stat, p_available, p_free_sell, p_cap_level, p_status_code, p_error_code
Dim OraDatabase, PlSqlStmt
Response.Write "In Function add_cc_rec<br>"
msg = ""
stat = ""
p_available = "Y"
p_free_sell = "Y"
p_cap_level = "0"
p_status_code = 2
p_error_code = ""
Set OraSession = Server.CreateObject("OracleInProcServer.XOraSession")
Response.Write "Created OraSession<br>"
Set OraDatabase = OraSession.OpenDatabase(ORADB, RUUID &"/"& RUPWD, 0)
'Set OraDatabase = OraSession.DbOpenDatabase(ORADB, RUUID &"/"& RUPWD,cint(0))
'Set OraDatabase = OraSession.DbOpenDatabase(ORADB, UID &"/"& PWD,cint(0))
Response.Write "Created OraDatabase with the following parameters<br>"
Response.Write "Database is " & ORADB & "<br>"
Response.Write "UserId is " & RUUID & "<br><br>"
OraDatabase.Parameters.Add "p_location_rental_object_num", p_location_rental_object_num, ORAPARM_INPUT, ORATYPE_VARCHAR2
OraDatabase.Parameters.Add "p_available", p_available, ORAPARM_INPUT, ORATYPE_VARCHAR2
OraDatabase.Parameters.Add "p_start_date", p_start_date, ORAPARM_INPUT, ORATYPE_VARCHAR2
OraDatabase.Parameters.Add "p_end_date", p_end_date, ORAPARM_INPUT, ORATYPE_VARCHAR2
OraDatabase.Parameters.Add "p_free_sell", p_free_sell, ORAPARM_INPUT, ORATYPE_VARCHAR2
OraDatabase.Parameters.Add "p_quantity", p_quantity, ORAPARM_INPUT, ORATYPE_VARCHAR2
OraDatabase.Parameters.Add "p_cap_level", p_cap_level, ORAPARM_INPUT, ORATYPE_VARCHAR2
OraDatabase.Parameters.Add "p_rate_code", p_rate_code, ORAPARM_INPUT, ORATYPE_VARCHAR2
OraDatabase.Parameters.Add "p_status_code", p_status_code, ORAPARM_OUTPUT, ORATYPE_NUMBER
OraDatabase.Parameters.Add "p_error_code", p_error_code, ORAPARM_OUTPUT, ORATYPE_VARCHAR2
Response.Write "Calling PL/SQL procedure cc_insert <br>"
Set PlSqlStmt = OraDatabase.CreateSQL("Begin RATELINK_CAPACITY_CONTROL.cc_insert(:p_location_rental_object_num, :p_available, :p_start_date, :p_end_date, :p_free_sell, :p_quantity, :p_cap_level, :p_rate_code, :p_status_code, :p_error_code); end;", ORASQL_DEFAULT)
Response.Write "PL/SQL procedure cc_insert has been called <br>"
Response.Write "Status code from PL/SQL procedure cc_insert (" & OraDatabase.Parameters("p_status_code").value & ")<br>"
Response.Write "Error code from PL/SQL procedure cc_insert (" & OraDatabase.Parameters("p_error_code").value & ")<br>"
'Response.Write "Error code from PL/SQL procedure cc_insert (" & p_error_code & ")<br>"
OraDatabase.Parameters.Remove "p_location_rental_object_num"
OraDatabase.Parameters.Remove "p_available"
OraDatabase.Parameters.Remove "p_start_date"
OraDatabase.Parameters.Remove "p_end_date"
OraDatabase.Parameters.Remove "p_free_sell"
OraDatabase.Parameters.Remove "p_quantity"
OraDatabase.Parameters.Remove "p_cap_level"
OraDatabase.Parameters.Remove "p_rate_code"
OraDatabase.Parameters.Remove "p_status_code"
OraDatabase.Parameters.Remove "p_error_code"
Set OraSession = Nothing
Set OraDatabase = Nothing
End Sub1 - Can I clear errors on the OraDatabase class. How do
I do that?They store the last error, should clear itself.
2. Is this a client side or server side error? If this
is a client side error, how do I resolve it?Server side error only. Make sure the user you connect as can see 'RATELINK_CAPACITY_CONTROL.CC_INSERT' and has execute permissions on it. You may need to qualify it with a schema name if the connected user is not the schema owner. -
Problems calling stored procedure with DG4IFMX
Hi guys,
I am trying to call stored procedures from Informix Database which is connected through Oracle Database Gateway for Informix.
I have run select,update,delete successfully but when i try to run a stored procedure nothing happens.
for example :
when i run
call "branko"@link_informix(1)
it returns that it is successfully executed, without any error, but as u can see bellow no entry is entered in the branko_test table
at informix :
drop procedure branko;
create procedure "informix".branko(_vlez integer)
returning boolean;
if _vlez = 1 then
insert into branko_test values('test uspesen','1');
else
insert into branko_test values('test uspesen 2','2');
end if;
end procedure;
the procedure runs ok when called from informix.
Thank you for any help
P.S i have even tried running:
declare
ret integer;
begin
ret := DBMS_HS_PASSTHROUGH.EXECUTE_IMMEDIATE@link_informix('execute procedure branko(2)');
end;
but the same thing is happening, no entry in the table branko_test.Found the root cause:
when using dbaccess to call the original procedure it reports on the screen (expression)
=> removing the return value as it is not handled
-> looks like the unhandled return value boolean. Modifying the procedure to
drop procedure branko;
create procedure "informix".branko(_vlez integer)
if _vlez = 1 then
insert into branko_test values('test uspesen','1');
else
insert into branko_test values('test uspesen 2','2');
end if;
end procedure;
allows me to execute the procedure using passthrough
DECLARE
result VARCHAR2(50);
BEGIN
result := DBMS_HS_PASSTHROUGH.EXECUTE_IMMEDIATE@dg4ifmx('execute procedure informix.branko(1)');
END;
Edited by: kgronau on May 6, 2011 7:31 AM -
Problems calling stored procedure with out ref cursors
Hi,
I am calling an oracle stored procedure and having problems. This is the code:
ResultSet cursor1, cursor2, cursor3, cursor4,cursor5,cursor6;
String sql = "BEGIN SYSADM.PKG_SERVICE.SERV_MAIN(:1,:2,:3,:4,:5,:6,:7,:8,:9) \n; END;";
CallableStatement call = null;
try
call = conn.prepareCall(sql);
call.setString(1,blah1);
call.setString(2,blah2);
call.setString(3,blah3);
call.registerOutParameter(4,OracleTypes.CURSOR);
call.registerOutParameter(5,OracleTypes.CURSOR);
call.registerOutParameter(6,OracleTypes.CURSOR);
call.registerOutParameter(7,OracleTypes.CURSOR);
call.registerOutParameter(8,OracleTypes.CURSOR);
call.registerOutParameter(9,OracleTypes.CURSOR);
call.execute();
cursor1 = ((OracleCallableStatement) call).getCursor(4);
cursor2 = ((OracleCallableStatement) call).getCursor(5);
cursor3 = ((OracleCallableStatement) call).getCursor(6);
cursor4 = ((OracleCallableStatement) call).getCursor(7);
cursor5 = ((OracleCallableStatement) call).getCursor(8);
cursor6 = ((OracleCallableStatement) call).getCursor(9);
on the cursor1 = line I get this exception:
06/08/08 15:07:01 java.lang.ClassCastException: com.evermind.sql.FilterCallableStatement
this is a web service running in JDeveloper 10.1.2
DennisDennis,
There is only one "data-sources.xml" file in my JDeveloper 10.1.3. It is in the "\j2ee\home\config" subdirectory.
But the again, I have not used my JDeveloper to create any Web services.
I really think you should try the JDeveloper and ADF forum.
Also, there are several debug properties you can set for OC4J.
Since you say you are using 10.1.2, the following Web page may be helpful:
http://www.oracle.com/technology/tech/java/oc4j/htdocs/oc4j-logging-debugging-technote.html
Good Luck,
Avi. -
Problem calling Stored Procedure returning SETOF UDT (Using Spring)
I am using Spring's StoredProcedure class to call a stored procedure from a PostgreSql database. It returns a set of user defined data types. I'm having a problem in parsing the results returned.
The user defined data type :
CREATE TYPE process_states AS (
process_name text,
process_type text
The stored procedure returns a SET of "process_state" :
CREATE FUNTION inquire_process_state (.....)
RETURNS SETOF process_state AS '
SELECT ....
I hava a Java class extending the Spring StoredProcedure classs.
public MyProcStats extends StoredProcedure {
private class ProcStateCallBackHandler implements RowCallBackHandler {
public void processRow(ResultSet rs) throws SQLException {
System.out.println(rs.getString(1));
public MyProcStats (DataSource ds) {
super(ds, "inquire_process_state");
super.setFunction(true);
declareParameter(new SqlOutparameter("rs", Types.OTHER, new ProcStateCallBackHandler());
declareParameter(new SqlParameter("family_name", Types.VARCHAR) ;
While testing this class, I get an errormessage
"java.sql.SQLException:ERROR: cannot display a value of type record"
I would appreciate if anyone can point out my mistakes. I tried declaring
new SqlOutParameter("rs", Types.OTHER, "process_state"), but that didn't help.As the related posts suggest, you will need to use direct JDBC code for this.
Also I'm not sure JDBC supports the RECORD type, so you may need to wrap your stored functions with ones that either flatten the record out, or take OBJECT types. -
Problem calling stored procedure with user-defined type of input parameters
Hi,
I have to call a stored procedure with IN parameters, but these are user-defined types of input parameters.
function fv_createnews (
pit_groups in T_APPLICATION_USER_GROUPS,
pit_documents in T_DOCUMENTS
return varchar2;
TYPE T_APPLICATION_USER_GROUPS IS
TABLE OF varchar2(500)
INDEX BY binary_integer;
TYPE T_DOCUMENT IS record (
name varchar2(256)
,url varchar2(1024)
,lang varchar2(30)
,foldername varchar2(150)
TYPE T_DOCUMENTS IS
TABLE OF T_DOCUMENT
INDEX BY binary_integer;
How can I do this using the TopLink 10.1.3 API.
I already found following related posts, but I still can' t make it up:
Using VARRAYs as parameters to a Stored Procedure
Pass Object as In/Out Parameter in Stored Procedure
Or do I have to create my own PreparedStatement for this special stored procedure call using Java and Toplink?As the related posts suggest, you will need to use direct JDBC code for this.
Also I'm not sure JDBC supports the RECORD type, so you may need to wrap your stored functions with ones that either flatten the record out, or take OBJECT types. -
Calling a procedure from an OAF page through a button in the screen
problem: calling a procedure from an OAF page through a button in the screen
CREATE OR REPLACE procedure APPS.xx_delete_dept_prc(p_id in number)
as
begin
delete from xx_training_dept_tbl where td_dept_id=p_id;
commit;
end;
2. create image button for delete
3. set the following property to this button:
action type : fire action
event :DeleteDept
parameter :
name: DEptIdParam value: ${oa.XxTrainingDeptVO1.TdDeptId}
4. create Co and writing the following code on process form request
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
String actionInscreen=pageContext.getParameter(EVENT_PARAM);
if ("deleteDept".equals(actionInscreen))
String deptidparam=pageContext.getParameter("DeptIdParam");
Serializable [] s={deptidparam};
Class [] c={deptidparam.getClass()};
OAApplicationModule am=pageContext.getApplicationModule(webBean);
am.invokeMethod("deleteDept",s,c);
throw new OAException("delete completed",OAException.INFORMATION);
5. create AM and writing the following code
public void deleteDept(String deptid) {
XxTrainingDeptVOImpl deptview= getXxTrainingDeptVO1();
deptview.deleteDept(deptid); }
6.create VO and writing the following code in view object class
public void deleteDept(String deptid
System.out.println("Dept ID =" +deptid);
String s = "call xx_delete_dept_prc(:1)"; // :1 is the number of parameter to pass it to procedure
CallableStatement cs =trx.createCallableStatement(s,1); // 1 number of record to fetch but delete always delete 1 row
try
cs.setString(1,deptid); // the name of the first parameter
cs.execute();
cs.close();
catch (SQLException e)
e.printStackTrace();
} -
JDBC Control - Calling Stored Procedure
Hi people,
I have a big problem calling my procedure by jdbcControl, It might by easy to solve, but I don´t know what is wrong.
My stored procedure return a Doube value, a key to be used in my system.
Follow my Oracle procedure definition:
--one cursor
TYPE TCursor_Ret IS REF CURSOR;
-- My procedure
PROCEDURE PRSMS_RET_INVOKE_ID(pCURSOR OUT MY_PACKEGE.TCURSOR_RET) IS
vNrChamadoServico sn_mensagem_portabilidade.nr_chamado_servico%TYPE; -- Number
BEGIN
-- THE IDENTIFICADOR HAS 15 digits
vNrChamadoServico := FNSMS_BUSCA_VLR_PARAMETRO('0','IND_BASE_PORTAB') * power(10, 13);
OPEN pCURSOR FOR
SELECT (vNrChamadoServico + sq_nr_chamado_servico.NEXTVAL) AS invokeID
FROM dual; -- retur '10000000000015'
END PRSMS_RET_INVOKE_ID;
In my JPD process I did something like this:
public JdbcControl.SQLParameter[] parms = new JdbcControl.SQLParameter[1];
--A cursor to be returned by oracle
parms[0] = new JdbcControl.SQLParameter(new Double(0),Types.DOUBLE, JdbcControl.SQLParameter.OUT);
myJdbcControl.getInvokeID(parms);
In my jdbcControl I have:
@JdbcControl.SQL(statement ="call MY_PACKAGE.PRSMS_RET_INVOKE_ID(?)")
Double getInvokeID(JdbcControl.SQLParameter[] params)throws SQLException;
And I got the following error:
[BEA][Oracle JDBC Driver][Oracle]ORA-06553: PLS-306: wrong number or types of arguments in call to 'PRSMS_RET_INVOKE_ID'
I am using the follow example:
http://mail-archives.apache.org/mod_mbox/beehive-commits/200702.mbox/%[email protected]%3E
I have Tried use as parameter LONG, NUMER, BIGDECIMAL and so one, but I haven't sucessfull. :(
Could someone give me some hint?
Edited by denimar at 06/10/2008 4:10 PMHi guys,
I Talked to my Oracle´s DBA and he give the the following advice:
We changed the return TYPE.
The old procedure returned TYPE TCursor_Ret IS REF CURSOR
And now It return NUMBER
FUNCTION FNSMS_RET_INVOKE_ID RETURN NUMBER IS
vRESULT NUMBER;
vCursor TCURSOR_RET;
BEGIN
PRSMS_RET_INVOKE_ID(vCursor);
FETCH vCursor
INTO vRESULT;
RETURN(vRESULT);
END FNSMS_RET_INVOKE_ID;
Now I can catch the return value like this:
select MY_PACKAGE.FNSMS_RET_INVOKE_ID from dual
Bye bye!! -
About JDBC CALL STORE PROCEDURE with out parameter is greater than 4000
Hi Guys,
I have a problem call store procedure with a large string.
as i know varchar2 can contain 32767 characters in pl/sql .
But when i used varchar2 as a out parameter in a store procedure, if the out parameter is greater than 4000 characters , it always give me error message as 'the buffer is too small'.
why it happened?
I read some article that says i need configure a property in data-source.xml , and jdbc 10g driver already solved this problem, but i used jdev 10.1.3.2 ,the driver should be fine.
How can i solve this problem?
Thanks in advance,
AppCatObject is Foundation, Execute Script
This is for a query, you can change to a stored procedure call. Pull the value back in the Java code then put into the process variable.
import javax.naming.InitialContext;
import javax.sql.DataSource;
import java.sql.*;
PreparedStatement stmt = null;
Connection conn = null;
ResultSet rs = null;
try {
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:IDP_DS");
conn = ds.getConnection();
stmt = conn.prepareStatement("select FUBAR from TB_PT_FUBAR where PROCESS_INSTANCE_ID=?");
stmt.setLong(1, patExecContext.getProcessDataLongValue("/process_data/@inputID"));
rs = stmt.executeQuery();
rs.next();
patExecContext.setProcessDataStringValue("/process_data/outData", rs.getString(1));
} finally {
try {
rs.close();
} catch (Exception rse) {}
try {
stmt.close();
} catch (Exception sse) {}
try {
conn.close();
} catch (Exception cse) {} -
Permission problem calling a java object from a store procedure
When I run my store procedure
CREATE OR REPLACE PACKAGE BODY confirms_write_to_file
AS
FUNCTION translate(in_en_var in VARCHAR2)
RETURN VARCHAR2
AS LANGUAGE JAVA
NAME 'translate.translatePath(java.lang.String) return java.lang.String';
PROCEDURE write_to_file(in_file_name IN VARCHAR, in_en_var IN VARCHAR)
IS
file_handle UTL_FILE.FILE_TYPE;
file_location VARCHAR2(50);
BEGIN
file_location := translate(in_en_var);
dbms_output.put_line ('opened file location' ||file_location);
END write_to_file;
END confirms_write_to_file;
I get the following error:
exec confirms_write_to_file.write_to_file('zzzz','$RIMS_LOG');
SQL> exec confirms_write_to_file.write_to_file('zzzz','$RIMS_LOG');
Exception java.security.AccessControlException: the Permission
(java.io.FilePermission <<ALL FILES>> execute) has not been granted by
dbms_java.grant_permission to
SchemaProtectionDomain(RIMS|PolicyTableProxy(RIMS))
opened file locationProcess problem
PL/SQL procedure successfully completed.
When I try to to grant myself the permissions
begin
dbms_java.grant_permission('rims','java.io.FilePermission','*','execute');
dbms_java.grant_permission('rims', 'java.lang.RuntimePermission', '*','writeFileDescriptor' );
end;
I get the following Error:
oracle.aurora.vm.IdNotFoundException: rims is not a user or role
at oracle.aurora.rdbms.DbmsRealm.getId(DbmsRealm.java)
at oracle.aurora.rdbms.DbmsRealm.getId(DbmsRealm.java)
at
oracle.aurora.rdbms.security.PolicyTableManager.findAll(PolicyTableManager.java)
at oracle.aurora.rdbms.security.PolicyTableManager.find(PolicyTableManager.java)
at
oracle.aurora.rdbms.security.PolicyTableManager.activate(PolicyTableManager.java
at
oracle.aurora.rdbms.security.PolicyTableManager.grant(PolicyTableManager.java)
begin
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
oracle.aurora.vm.IdNotFoundException: rims is not a user or role
ORA-06512: at "SYS.DBMS_JAVA", line 0
ORA-06512: at line 2
My java code is as follows
import java.io.*;
import java.util.*;
class translate
public static String translatePath(String envar)
Runtime rt = Runtime.getRuntime();
int bufSize = 4096;
byte buffer[] = new byte[bufSize];
String path = null;
Process p = null;
int len = 0;
try
p = rt.exec("echo "+envar);
BufferedInputStream bis = new BufferedInputStream(p.getInputStream());
while ((len = bis.read(buffer, 0, bufSize)) != -1)
System.out.write(buffer, 0, len);
path = new String(buffer);
p.waitFor();
catch(Exception e)
System.out.println("Exception "+e);
return "Process problem ";
return path;Tony,
I answered this very same question that you posted at the JavaRanch forum.
Good Luck,
Avi. -
Problem calling PL/SQL procedures from Function Activity Issue
Hi,
I am working with Oracle Workflow and I have found some problems adding a function activity in the process diagram. This function only updates some registers on the data base, or at least it should do that.
I have been looking through the items in this forum and I have found similar things but not the right one. Of course I am a learner in all this and maybe the answer in there.
I will try to show you my problem:
When the procedure is supposed to be called, it doesnt´t do that and instead I found the following error:
Wf_Engine_Util.Function_Call(usuario.WF_FIN_TG.FINTG1, FLUJO1, 092S0087, 588782, RUN) ORA-01403: no data found
I have tested all the queries from TOAD and SAL Server, and all of them return some results.
I have tried to take out all the queries from the procedure as the following to try to avoid or change the error but it continues as "ORA-01403: no data found":
PROCEDURE FINTG1(
p_itemtype IN VARCHAR2,
p_itemkey IN VARCHAR2,
p_actid IN NUMBER,
p_funcmode IN VARCHAR2,
p_resultado IN OUT VARCHAR2
) IS
flujo VARCHAR2(;
p_resultado :=1;
END FINTG1;
It seems as the workflow engine try to search something before executing my procedure.
Has anybody any idea about how to solve this problem? Thanks a lot.WF_ENGINE_UTIL.Function_Call is the lowest level procedure executed by the engine before it executes the procedure associated with the function activity. I am not sure if this procedure would throw ORA 1403 since this does not have a query or a collection.
Please note that ORA 1403 could occur from a SQL query or a collection.
Looking at your code, p_resultado :=1;
The function activity should return a resultout that the workflow engine understands. The valid results from the function activities as per the workflow guide are,
wf_engine.eng_completed - 'COMPLETE'; -- Normal completion
wf_engine.eng_active - 'ACTIVE'; -- Activity running
wf_engine.eng_waiting - 'WAITING'; -- Activity waiting to run
wf_engine.eng_notified - 'NOTIFIED'; -- Notification open
wf_engine.eng_suspended - 'SUSPEND'; -- Activity suspended
wf_engine.eng_deferred - 'DEFERRED'; -- Activity deferred
wf_engine.eng_error - 'ERROR'; -- Completed with error
You would normally use COMPLETE or ERRORED within your activity. Please change your code to use a valid resultout and try again.
Hope this helps.
Thanks -
Db Adapter: problems by calling a procedure with type as parameter
Hi,
We using a db adapter in a bpel process.
In that dapter we call a procedure with types as in and out parameter
package.procedure(p_in IN in_t, p_rsult OUT result_t).
When we calling the procedure, we don't call the procedure directly.
We call that procedure in a schema who have the execute rigths for the package and the types.
When we run the process we get the error message
unable to convert the xsd element p_in whose user defined type is in_t
cause: java.sql.SQLException: ora-01436 connect by loop in user data
I am not shore if I draw the right conclusions.
Is it rigth that bpel have a problem by using types as parameter when using two schematas? Isn't it a bug.
For every help I was thankful.
Thanks in advanced.
MichaelHi,
thanks for the hint. I have implemented a wrapper package and it's working well.
Only one crux. The parameter of the called procedure are data types and not simple types.
CREATE OR REPLACE TYPE pesa_db_return_t AS OBJECT
(SUCCESS_MSG varchar2(255)
,FAULT_SQLCODE varchar2(255)
,FAULT_SQLMSG varchar2(255)
Wrapper package...
IS
PROCEDURE prc_writeReOinDB (p_AuftragRechnungOnline IN pesa_data.pesa_tivu_reo_t
,p_result OUT pesa_data.pesa_db_return_t)
IS
BEGIN
pkg_pesa_reo.prc_writeReOinDB (p_AuftragRechnungOnline => p_AuftragRechnungOnline
,p_result => p_result
END prc_writeReOinDB;
END pkg_pesa_wrapper;
So I have to declare the parameter with the schema user in front of.
Now, we have deployed thes sources on a second enviroment and get following error:
<2008-04-22 15:01:25,749> <ERROR> <eweber.collaxa.cube.engine.dispatch> <BaseScheduledWorker::process> Failed to handle dispatch message ... exception ORABPEL-05002
Message handle error.
An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.instance.CallbackDeliveryMessage"; the exception is: Type class not found.
Cannot find class for type "org.apache.xerces.dom.ElementNSImpl". Please check that the class is located in the classpath.
You have a hint for me what I have to do?
Thanks in advanced,
Michael -
Problem to call a procedure in Oracle
Hi,
I create a simple Oracle procedure like following
CREATE OR REPLACE PROCEDURE util_session_insertion (in_user_id IN NUMBER, in_note IN VARCHAR2, v_next_id OUT NUMBER)
IS
BEGIN
-- get next id
SELECT session_id_seq.nextval INTO v_next_id FROM dual;
-- insert into session table
INSERT INTO sessions (session_id, user_id, notes, source_agency_id) VALUES (v_next_id, in_user_id, in_note);
commit;
EXCEPTION WHEN OTHERS THEN
rollback;
END;
and I try to call the procedure as follows
cstmt = conn.prepareCall("{call util_session_insertion(?, ?, ?)}");
cstmt.setInt(1, Integer.parseInt(request.getParameter("user_id")));
cstmt.setString(2, request.getParameter("notes"));
cstmt.registerOutParameter(3, java.sql.Types.INTEGER);
cstmt.execute();
v_session_id = cstmt.getInt(1);
The record is inserted, but I always get the error message
java.sql.SQLException: Invalid column index
How to I fix this problem?
Thanks,
Gracecstmt.registerOutParameter( 3, java.sql.Types.INTEGER);
cstmt.execute();
v_session_id = cstmt.getInt( 1,);
The record is inserted, but I always get the error
message
java.sql.SQLException: Invalid column index
How to I fix this problem?The error message tells you exactly what is wrong.
Maybe you are looking for
-
When to use SELECT and END SELECT in the query.
hi all, When to use SELECT and END SELECT in the query. regads, Venkata Suresh Penke.
-
ITunes Match Broken since iOS8
ive been having major problems with iTunes match since the update first when i tap on a song on my device it plays but then downloads to the system and can't be cleared off unless I hit the cloud button "download" the track again and then swipe to de
-
Hi, I am wondering if any one successfully implemented CCA retractor in version BW-BPS 3.50? Thanks CN
-
Setting tomcat cluster with F5 device, not working
Hi. I have 2 servers each with tomcat 5.0.28 on them, I am trying to set up a cluster but when i do as the instructions say in tomcat clustering references, the server which has the apache on it after i change the server.xml files you can't log onto
-
Dynamically determine location for a file relatively to current CLASSPATH
Hi All, I am quite new to Java and I have a problem. I am trying to write a program that can dynamically determine the location of a file (the class that handles this will only have the relative path/file name). Eg. File f = new File(config/MyMainCfg