Error while calling stored procedure from Java
Hi Guys,
How are you everybody? I hope everything is goin fine on your side. I have one issue in PL/SQL while calling below stored procedures from Java.
Problem Description: We have a stored procedure PROCEDURE BULK_INSERTS (
V_SESSION_ID_TAB IN T_SESSION_ID_TAB_TYPE,
V_SERVICE_TYPE_TAB IN T_SERVICE_TYPE_TAB_TYPE,
V_SERVICE_LOCATION_TAB IN T_SERVICE_LOCATION_TAB_TYPE,
V_SERVICE_CALL_NAME_TAB IN T_SERVICE_CALL_NAME_TAB_TYPE,
V_SERVICE_CALL_START_TIME_TAB IN T_SERVICE_CALL_ST_TAB_TYPE,
V_SERVICE_CALL_END_TIME_TAB IN T_SERVICE_CALL_ET_TAB_TYPE,
V_SERVICE_CALL_DURATION_TAB IN T_SERVICE_CALL_DUR_TAB_TYPE,
V_STATUS_TAB IN T_STATUS_TAB_TYPE,
V_NOTES_TAB IN T_NOTES_TAB_TYPE
) and we are getting ora errors while calling this stored procedure from java.
All tab types are declared locally, at package level.
Here is error which occur while calling this sp:
{call BULK_PKG.BULK_INSERTS(?,?,?,?,?,?,?,?,?)}
And the parameter types we are using are:
SESSION_ID - NUM_TAB_TYPE
SERVICE_TYPE - VAR_TAB_TYPE
SERVICE_LOCATION - VAR_TAB_TYPE
SERVICE_CALL_NAME - VAR_TAB_TYPE
SERVICE_CALL_START_TIME - DATE_TIME_TAB_TYPE
SERVICE_CALL_END_TIME - DATE_TIME_TAB_TYPE
SERVICE_CALL_DURATION - NUM_TAB_TYPE
STATUS - VAR_TAB_TYPE
NOTES - VAR_TAB_TYPE
And the Exception stack trace is:
ERROR (com.att.retail.r2d2.persistence.dao.ExternalServiceCallDAO.saveExternalServiceCallInfo(ExternalServi
ceCallDAO.java:143)@ExecuteThread: '252' for queue: 'weblogic.kernel.Default') {Error attempting to save collected ESC data}
java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1030)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:191)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:944)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3482)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3856)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1373)
at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:98)
at com.att.retail.r2d2.persistence.dao.ExternalServiceCallDAO.doBulkInsert(ExternalServiceCallDAO.java:220)
at com.att.retail.r2d2.persistence.dao.ExternalServiceCallDAO.saveExternalServiceCallInfo(ExternalServiceCallDAO.java:138)
Please help my guys out of this. I will really appreciate all suggestions and advices.
Thank you everybody.
I am trying to pass parameter to test my procedure but it is giving this error : ORA-06531: Reference to uninitialized collection
ORA-06512: at line 12
Here is example for my test procedure:
declare
v_session_id_tab SESSION_ID_TAB_TYPE;
v_service_type_tab SERVICE_TYPE_TAB_TYPE ;
v_service_location_tab SERVICE_LOCATION_TAB_TYPE ;
v_service_call_name_tab SERVICE_CALL_NAME_TAB_TYPE;
v_service_call_start_time_tab SERVICE_CALL_ST_TAB_TYPE;
v_service_call_end_time_tab SERVICE_CALL_ET_TAB_TYPE;
v_service_call_duration_tab SERVICE_CALL_DUR_TAB_TYPE;
v_status_tab STATUS_TAB_TYPE;
v_notes_tab NOTES_TAB_TYPE;
begin
v_session_id_tab(1) := 1;
v_service_type_tab(1) := 'db';
v_service_location_tab(1) := 'local';
v_service_call_name_tab(1) := 'Name of call';
v_service_call_start_time_tab(1) := SYSDATE;
v_service_call_end_time_tab(1) := SYSDATE;
v_service_call_duration_tab(1) := 100;
v_status_tab(1) := 'Z';
v_notes_tab(1) := 'NOTES';
BULK_INSERTS (v_session_id_tab,v_service_type_tab, v_service_location_tab,v_service_call_name_tab,v_service_call_start_time_tab,v_service_call_end_time_tab,
v_service_call_duration_tab, v_status_tab, v_notes_tab);
end;
I declare all types at schema level.
Please give your comments.
Thank you
Similar Messages
-
Error while calling stored procedure from apps adapter
Hi,
I am calling Oracle applications standard api to create ar invoice (XX_BPEL_TEST_APPS_ADAPTER_PKG is the name of wrapper package created by adapter) from apps adapter but getting the following error:
Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'test_apps_adapter' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the APPS.XX_BPEL_TEST_APPS_ADAPTER_PKG.AR_INVOICE_API_PUB$CREATE_SIN API. An error occurred while preparing and executing the APPS.XX_BPEL_TEST_APPS_ADAPTER_PKG.AR_INVOICE_API_PUB$CREATE_SIN API. Cause: java.sql.SQLException: ORA-06531: Reference to uninitialized collection ORA-06512: at "APPS.XX_BPEL_TEST_APPS_ADAPTER_PKG", line 199 ORA-06512: at "APPS.XX_BPEL_TEST_APPS_ADAPTER_PKG", line 909 ORA-06512: at line 1 Check to ensure that the API is defined in the database and that the parameters match the signature of the API. This exception is considered not retriable, likely due to a modelling mistake. To classify it as retriable instead add property nonRetriableErrorCodes with value "-6531" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
Just wondering if anyone has faced a similar problem?I am trying to pass parameter to test my procedure but it is giving this error : ORA-06531: Reference to uninitialized collection
ORA-06512: at line 12
Here is example for my test procedure:
declare
v_session_id_tab SESSION_ID_TAB_TYPE;
v_service_type_tab SERVICE_TYPE_TAB_TYPE ;
v_service_location_tab SERVICE_LOCATION_TAB_TYPE ;
v_service_call_name_tab SERVICE_CALL_NAME_TAB_TYPE;
v_service_call_start_time_tab SERVICE_CALL_ST_TAB_TYPE;
v_service_call_end_time_tab SERVICE_CALL_ET_TAB_TYPE;
v_service_call_duration_tab SERVICE_CALL_DUR_TAB_TYPE;
v_status_tab STATUS_TAB_TYPE;
v_notes_tab NOTES_TAB_TYPE;
begin
v_session_id_tab(1) := 1;
v_service_type_tab(1) := 'db';
v_service_location_tab(1) := 'local';
v_service_call_name_tab(1) := 'Name of call';
v_service_call_start_time_tab(1) := SYSDATE;
v_service_call_end_time_tab(1) := SYSDATE;
v_service_call_duration_tab(1) := 100;
v_status_tab(1) := 'Z';
v_notes_tab(1) := 'NOTES';
BULK_INSERTS (v_session_id_tab,v_service_type_tab, v_service_location_tab,v_service_call_name_tab,v_service_call_start_time_tab,v_service_call_end_time_tab,
v_service_call_duration_tab, v_status_tab, v_notes_tab);
end;
I declare all types at schema level.
Please give your comments.
Thank you -
Error while fetching Stored procedure from JDev DB Adapter
Hello
I am facing a problem while configuring stored procedures from Jdeveloper using DB Adapter. I am using Sql Server 2005 as my database,Jdeveloper version is 10.1.3.1.Bpel Version is 10.1.3.3. Connection to the Sqlserver 2005 database is fine, but it shows only views and tables. I get the following error message when I try to add the sql stored procedure call
"An error occured while obtaining the database schemas.Verify that the database connection is valid , and is supported"
Can someone help me please.
Thanks,
Phani
Edited by: Phani on Oct 28, 2008 11:30 AMI think you have two problems here. First, JDeveloper 10.1.3.1 doesn't support SQL Server stored procedures. There is a command-line utility that you can use to generate the required BPEL artifacts (WSDL and XSD). Second, you're using a 10.1.3.1 design-time with a 10.1.3.3 runtime. These are not compatible so you will likely run into namespace issues when you try to run your BPEL processes. You should upgrade your JDeveloper to 10.1.3.3. JDeveloper will support third-party databases in 11.1.1 including SQL Server 2005 (but not 2000), IBM DB2 v8.x and v9.x, DB2 AS/400, and MySQL. JDeveloper will support MySQL v5.2.6 and above because the INFORMATION_SCHEMA.PARAMETERS table was added at that time. The PARAMETERS table does not exist in MySQL versions prior to v5.2.6 so you will have to use the command-line utility.
-
Calling Stored Procedures from JAVA Application
Hi all,
i am using JDeveloper 3.2.2 for creating a DB Application that
uses Oracle8i as DB Server.
One approach of the application is to only use PL/SQL Stored
Procedures to write Data back to the DB.
Some of the stored procedures expect more than 20 parameters.
I want to know if there is a better way to call such a stored
procedure from Java than using a CallableStatement and setting
its 20 parameters.
Another reason why the way above isnt possible for me is that
i need a dynamic way to set the parameters of the stored
procedure.
A solution for that dynamic way i could think of is to get
the information of the stored procedure by using some functions
of DatabaseMetaData and than use this information to map the
parameters with their respective variables in the java
application.
The best argument against this way is that it would be time and
performance consuming.
So could anybody tell me a solution to call PL/SQL stored
procedures from java which is better than doing something like:
String calString = "{Call myStoredProc(";
while(counter < 22) {
params += "?";
if(counter<21) params += ",";
counter++;
calString += params + ")}";
try {
CallableStatement cs = session.prepareCall(calString);
} catch(SQLException ex) { ... }
cs.setString(1, var1);
cs.setString(1, var2);
And that for every Stored Procedure i want to call ?!?
Any help or direction-leading would be really appreciated.
Tank you much.
MfG,
Oliver BankelHi Oliver,
If you your Stored Procedures were in Java and seamlessly
integrated with your Java application would that make your life
easier?
I don't know if this is a practical or acceptable solution in
your environment but it would certainly solve all of your issues
and provide your with a couple of nice advantages. Scalability
and platform independence are just a couple I could think of.
There is a tool called in2j (see http://www.in2j.com) which will
automatically migrate your PL/SQL Stored Procedures into Java.
You can download a copy of the tool and migrate your PL/SQL to
Java with no upfront costs. If you're happy with the generated
Java and want to deploy it, the migration fee falls due - simple.
Hope this helps.
Elton -
Curious thing while calling a procedure from Java !...
Hi !. My name is Agustin and my doubt would be the following one... I am working for a e-business comp and they asked me to call a procedure from java... The code is the following one:
CallableStatement cs = null;
System.out.println("Fecha Nro. 1: " + paramFechaDesde);
System.out.println("Fecha Nro. 2: " + paramFechaHasta);
try
cs = getDBTransaction().createCallableStatement("{call paq_w_ListadoSiniestralidadART. p_sinsiniest(?,?,?,?) }",0);
cs.registerOutParameter(4,OracleTypes.VARCHAR);
cs.setInt(1,paramContrato.intValue());
cs.setString(2,paramFechaDesde);
cs.setString(3,paramFechaHasta);
cs.setString(4,paramNombreArchivo);
cs.executeQuery();
String nomArchivo = cs.getString(4);
System.out.println("### " + nomArchivo +" ###");
catch(SQLException e)
The weird thing is that, I was expecting a big big exception but the only thing I got is
### Error ###
The String I am expecting is a file's name !; so I am a little bit confused...
Also I didn't know where to post so If it's in the wrong category... I apologize !... If anyone need more details, I'll be checking out... The account I am working on is an Insurance company, who is the one who provide access to the DB and the procedures... So I can't check what's inside...Please provide your Java and OS versions, the JDBC jar file and the Oracle DB version being used when you post.
>
I was expecting a big big exception
>
Then why do you have an empty exception block? That just makes it disappear so you won't see one if it happens.
And your code has
cs.registerOutParameter(4,OracleTypes.VARCHAR);
cs.setString(4,paramNombreArchivo);You use 'registerOutParameter' for an OUT parameter and the 'setXXX' methods for other parameters.
Remove the 'setSTring' for the OUT parameter.
Then as malcollmmc already said
>
Sounds like the PL/SQL is returning "Error" as the 4th parameter of the call
>
The actual value returned by PL/SQL is strictly determined by the PL/SQL code and Java and JDBC are not involved.
Fix the code problems, retest, and folllowup with whoever wrote the code if it still returns ERROR. -
Calling stored procedure from Java raises ORA-1722 exception
Hi,
As the title says, when I call the stored procedure from java I got the exception ORA-1722 (invalid number) but I've checked and rechecked my procedure on SQL-Developer and It's alright it works nice and clean !
What's happening? is there something I'm missing?
The way I call the stored procedure is:
public void execProcedure(String procedure) {
CallableStatement cs;
try {
cs = conn.prepareCall(procedure);
cs.execute();
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex);
where
String procedure = "{call validateinfo}"I really need help on this, it's frustraiting me 'cause I need to finish a system but this little big problem is killing me ...
Thanks any advice is very welcome :)Thanks for your help. Haven't tested the SP with a DB access client... which one do you recommend to use?
The SP is the following:
create or replace
PROCEDURE validateInfo IS
var number;
BEGIN
UPDATE temp_desarrollo
SET status = '1';
COMMIT;
// Some string validations ...
//This one just checks if the value of "monto" is a number
//This update goes good
UPDATE temp_desarrollo tmp
SET cve_status = Decode(cve_status, NULL, '15', cve_status||',15')
WHERE IsNumber(tmp.monto) = 'F';
COMMIT;*/
//This one just checks if the value of "monto" is greater than 0
//if not, change de add to cve_status an errorValue
UPDATE temp_desarrollo tmp
SET cve_status = Decode(cve_status, NULL, '14', cve_status||',14')
WHERE (cve_status NOT LIKE '%15%' OR cve_status IS NULL)
AND to_number(tmp.monto) <= 0;
COMMIT;
//More string validations
EXCEPTION
WHEN OTHERS THEN
var := SQLCODE;
insert into excepciones values(to_char(var));
END;I've deleted much code from the SP since I know there's nothing to do with the excepcion, just that UPDATE statement is the one giving me the exception.
If those two UPDATES statements work with the same field (monto) why the first one is succeding and the second one not?
Cheers,
Federico
P.S. the "isNumber" function is as follows, just in case.
create or replace
function IsNumber(val1 varchar2) return varchar2 is
n number := null;
begin
n := to_number(val1,'9999999999999999.99');
return 'T';
exception
when others then
return 'F';
end; -
Error while calling a procedure from ESB
Hi,
I am calling a procedure from ESB using DB adapter. and in the routing rules i am mapping the i/p values for schema to procedure input variables using mappings(transformation) but the values are going as null to the procedure call.
Please help me out.
The exception follows...
An unhandled exception has been thrown in the ESB system. The exception reported is: "org.collaxa.thirdparty.apache.wsif.WSIFException: esb:///ESB_Projects/ESB-Issues_issue3/db3.wsdl [ db3_ptt::db3(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'db3' failed due to: Error while trying to prepare and execute an API.
An error occurred while preparing and executing the SYSTEM.INSERT_ISSUE_PROC API. Cause: java.sql.SQLException: ORA-01400: cannot insert NULL into ("SYSTEM"."ISSUES"."ISSUE_NAME")
ORA-06512: at "SYSTEM.INSERT_ISSUE_PROC", line 16
ORA-06512: at line 1
[Caused by: ORA-01400: cannot insert NULL into ("SYSTEM"."ISSUES"."ISSUE_NAME")
ORA-06512: at "SYSTEM.INSERT_ISSUE_PROC", line 16This is likely being caused by a problem that we've seen a number of times. You'll have namespace issues and problems with NULLs if your JDev is 10.1.3.1 and SOA is 10.1.3.3 (or vice-versa). You MUST synchronize JDev 10.1.3.3 (or higher) with SOA 10.1.3.3 (or higher). It doesn't matter if you mix 10.1.3.3 and 10.1.3.4. You just need to get away from 10.1.3.1.
-
Error while invoking stored procedure from BPEL process
Hi Folks,
I am facing the below mentioned issue while invoking a stored procedure in BPEL process :
I am trying to invoke a stored procedure from a BPEL process. The process runs fine for the first/second time, but gives the below error after that whenever i try to run the process :
file:/oracle/orasoa/bpel/domains/default/tmp/.bpel_ProvisionOrderASAPReqABCSImpl_1.0_50dd1595129e9bbb00560e31e7c18cef.tmp/DB_CALL_GetPendingSubscriptionProc.wsdl [ DB_CALL_GetPendingSubscriptionProc_ptt::DB_CALL_GetPendingSubscriptionProc(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'DB_CALL_GetPendingSubscriptionProc' failed due to: Error while trying to prepare and execute an API.
An error occurred while preparing and executing the PROC_GET_PENDING_SUBSCR API. Cause: java.sql.SQLException: Io exception: Connection reset [Caused by: Io exception: Connection reset]
; nested exception is:
ORABPEL-11811
Error while trying to prepare and execute an API.
An error occurred while preparing and executing the PROC_GET_PENDING_SUBSCR API. Cause: java.sql.SQLException: Io exception: Connection reset [Caused by: Io exception: Connection reset]
Check to ensure that the API is defined in the database and that the parameters match the signature of the API. Contact oracle support if error is not fixable.
I am not getting how the BPEL is referring to the DB wsdl from the tmp folder. To resolve this issue, we have to stop the SOA server, delete the tmp files, and restart the server.
Any pointers in this regard will be really helpful.First of all does this scenario occur again.
"Works first/second time. Later gives this error."
After you restart the SOA server are you able to reproduce this scenario?
As already pointed out and from the error message, database connection is reset.
If you find this error again, try this out.
em -> home / oc4j_soa -> Administration -> JDBC Resources
Use the "Test Connection" option for the Connection Pool that you are using for your database JNDI.
It comes back and say "Connection to "XYZCP" established successfully." it is good to use.
Run the BPEL process again and once you find the error, come back and test the connection.
If it comes back with Error, diagnose based on the error message received.
Cheers
Kalidass Mookkaiah
http://oraclebpelindepth.blogspot.com/ -
How to call stored procedures from java program?
I have tried to run a program that calls a stored procedure on MySQL
server version 5.0.17 by using connector/j 5.0, but it always fails on the
statement: con.preparecall() ,
have looked on the internet and found out that people can all mysql
stored procedure all right in their programs, really dont know what's
wrong with this small peiece of code:
import java.sql.*;
public class TestDB {
// procedure being called is:
CREATE PROCEDURE `dbsaystorm`.`getsite` ()
BEGIN
select name from tblsite;
END
public static void main(String[] args) {
try {
//Class.forName("org.gjt.mm.mysql.Driver");
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/dbname",
"user", "pwd");
* executing SQL statement here gives perfect correct results:
// PreparedStatement ps = con.prepareStatement("select name from tblsite");
// ResultSet rs =ps.executeQuery();
// but in stored procedure way...
//it fails here on this prepare call statement:
CallableStatement proc = con.prepareCall("call getsite()");
ResultSet rs =proc.executeQuery();
if (rs == null) return;
while (rs.next()){
System.out.println("site name is: "+ rs.getString(1));
rs.close();
} catch (SQLException e) {e.printStackTrace();}
catch (Exception e) {e.printStackTrace();}
}it always gives this exception:
java.lang.NullPointerException
at com.mysql.jdbc.StringUtils.indexOfIgnoreCaseRespectQuotes(StringUtils.java:959)
at com.mysql.jdbc.DatabaseMetaData.getCallStmtParameterTypes(DatabaseMetaData.java:1280)
at com.mysql.jdbc.DatabaseMetaData.getProcedureColumns(DatabaseMetaData.java:3668)
at com.mysql.jdbc.CallableStatement.determineParameterTypes(CallableStatement.java:638)
at com.mysql.jdbc.CallableStatement.<init>(CallableStatement.java:453)
at com.mysql.jdbc.Connection.parseCallableStatement(Connection.java:4365)
at com.mysql.jdbc.Connection.prepareCall(Connection.java:4439)
at com.mysql.jdbc.Connection.prepareCall(Connection.java:4413)
at saystorm.server.data.database.TestDB.main(TestDB.java:29)
where have I gone wrong?
when I commented out the statement that makes the procedure call and call preparedstatement to execute SQL select statement, it gave perfectly correct result.
it looks like there is no problem with java prog accessing MYSQL server database, but the it seems that it's just java can't call stored procedure stored on the mysql server version 5.
can it or can't it? if it can, how is that accomplished?It is a bug in the driver because it shouldn't be
returning that exception (null pointer) even if you
are doing something wrong.
Are you using the latest version of the driver?
The stored procedure runs when you run it from the
gui/command line using a MySQL tool - correct?
As suggested you should be using the brackets. What
is the data type of the 'name' field?
You could try returning another value like one of the
following
select 1, name from tblsite;
select name, 1 from tblsite;
That might get around the bug
Additionally try just the following...
select 'test' from tblsite;yes, the driver used is in connector/j 5.0--the lastest one, and the
procedure can run correctedly at either command line or GUI mode
with no problem whatsoever, the returned data type is string type,
I have not got the chance to test it again with those values you
suggested, as I have abandoned the laptop I used to write that code
initately. There have been some other really weird cases happened on
that computer. I guess that must be something wrong with the JVM
installed on it, it was upgraded from jre5.0.04 to 06, and to 09.
something within hte JVM must have been messed up(the only reasonable
explanation). Because the same code runs correctly on my new laptop,
using the same environment: jvm 5.0_09, mysql 5.0.18, connector/J 5.0.
that old laptop really was a nightmare. -
Calling stored procedure from java...
Hello,
I've got a stored procedure that works correctly if I call it in Toad like:
declare
c CLOB;
BEGIN
GETLOCATIONSVOXML (c, '0087890', 8, 2007);
END;
no problems there however I'm trying to call it from java..
public String getDALocations(String inEmplid, Date weekEndDate ) throws Exception {
Connection connection = null;
Clob loc;
String rtnSt = "";
SimpleDateFormat yy = new SimpleDateFormat("yyyy");
SimpleDateFormat ww = new SimpleDateFormat("ww");
try {
connection = getConnection();
CallableStatement cs = connection.prepareCall(SQL_GETDALOCATIONXML);
cs.registerOutParameter(1,oracle.jdbc.driver.OracleTypes.CLOB);
cs.setString(2, inEmplid);
cs.setString(3, ww.format(weekEndDate));
cs.setString(4, yy.format(weekEndDate));
cs.execute();
loc = (Clob)cs.getClob(1);
rtnSt = "<node label='locations'>" + loc.getSubString(1,(int)loc.length()) + "</node>";
cs.close();
log.debug("retrieved xml locations");
catch ( SQLException e ){
log.error("LocationDAO.getDALocations() failed", e);
throw new Exception(e);
} finally {
releaseConnection(connection);
return rtnSt;
[pre]
I'm getting the <node label='locations'></node> back, but nothing in between..
Anyone offer any suggestions or ideas I can try? I'm wondering if the data in Oracle is being read incorrectly.. Is there anyway I can check that?
Thanks so much!
Thanks!aha! seems to be a problem with my proc...
select c_schedulestatusid as status
from schedule_status
where location = 4131
and week = 11
and year = 2007
[pre]
part of my proc is returning null.. arg stupid error... -
JCA Error while calling Stored Procedure containing cursors in BPEL/OSB
Hi,
I created JCA DBAdapter in Jdeveloper for calling remote stored procedure which contains cursors as OUT parameters.
I'm getting below exception when i try to call the database via BPEL/OSB.the same remote procedure call is working on Invoking with WLI .
Kindly sugggest !!!
The invocation resulted in an error: I*nvoke JCA outbound service failed with connection error, exception: com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/ServiceBus/BusinessServices/IsdnSiebelConn [ IsdnSiebelConn_ptt::IsdnSiebelConn(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'IsdnSiebelConn' failed due to: Get object error.*
Error retrieving the value of a parameter R_NON_CNF_ATTR_CURSOR.
An error occurred when retrieving the value of parameter R_NON_CNF_ATTR_CURSOR after invoking the SIEBEL.ISDN_OBT_INS_DET.OBTAINASSETDETAILS API. Cause: java.sql.SQLException: Cursor is closed.
*; nested exception is:*
BINDING.JCA-11810
Get object error.
Error retrieving the value of a parameter R_NON_CNF_ATTR_CURSOR.
An error occurred when retrieving the value of parameter R_NON_CNF_ATTR_CURSOR after invoking the SIEBEL.ISDN_OBT_INS_DET.OBTAINASSETDETAILS API. Cause: java.sql.SQLException: Cursor is closed.
Check to ensure that the parameter has been correctly registered as a valid IN/OUT or OUT parameter of the API. This exception is considered retriable, likely due to a communication failure. To classify it as non-retriable instead add property nonRetriableErrorCodes with value "0" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers.
com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/ServiceBus/BusinessServices/IsdnSiebelConn [ IsdnSiebelConn_ptt::IsdnSiebelConn(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'IsdnSiebelConn' failed due to: Get object error.
Error retrieving the value of a parameter R_NON_CNF_ATTR_CURSOR.
An error occurred when retrieving the value of parameter R_NON_CNF_ATTR_CURSOR after invoking the SIEBEL.ISDN_OBT_INS_DET.OBTAINASSETDETAILS API. Cause: java.sql.SQLException: Cursor is closed.
; nested exception is:
BINDING.JCA-11810
Get object error.
Error retrieving the value of a parameter R_NON_CNF_ATTR_CURSOR.
An error occurred when retrieving the value of parameter R_NON_CNF_ATTR_CURSOR after invoking the SIEBEL.ISDN_OBT_INS_DET.OBTAINASSETDETAILS API. Cause: java.sql.SQLException: Cursor is closed.
Check to ensure that the parameter has been correctly registered as a valid IN/OUT or OUT parameter of the API. This exception is considered retriable, likely due to a communication failure. To classify it as non-retriable instead add property nonRetriableErrorCodes with value "0" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers.
at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invoke(JCATransportOutboundOperationBindingServiceImpl.java:153)
at com.bea.wli.sb.transports.jca.JCATransportEndpoint.sendRequestResponse(JCATransportEndpoint.java:209)
at com.bea.wli.sb.transports.jca.JCATransportEndpoint.send(JCATransportEndpoint.java:170)
at com.bea.wli.sb.transports.jca.JCATransportProvider.sendMessageAsync(JCATransportProvider.java:571)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.wli.sb.transports.Util$1.invoke(Util.java:83)
at $Proxy127.sendMessageAsync(Unknown Source)
at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.java:603)
at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:538)
at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:558)
at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:426)
at com.bea.wli.sb.test.service.ServiceMessageSender.send0(ServiceMessageSender.java:377)
at com.bea.wli.sb.test.service.ServiceMessageSender.access$000(ServiceMessageSender.java:76)
at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:134)
at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:132)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
at com.bea.wli.sb.test.service.ServiceMessageSender.send(ServiceMessageSender.java:137)
at com.bea.wli.sb.test.service.ServiceProcessor.invoke(ServiceProcessor.java:454)
at com.bea.wli.sb.test.TestServiceImpl.invoke(TestServiceImpl.java:172)
at com.bea.wli.sb.test.client.ejb.TestServiceEJBBean.invoke(TestServiceEJBBean.java:167)
at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.invoke(TestService_sqr59p_EOImpl.java:353)
at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:345)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl_1033_WLStub.invoke(Unknown Source)
at com.bea.alsb.console.test.TestServiceClient.invoke(TestServiceClient.java:174)
at com.bea.alsb.console.test.actions.DefaultRequestAction.invoke(DefaultRequestAction.java:117)
at com.bea.alsb.console.test.actions.DefaultRequestAction.execute(DefaultRequestAction.java:70)
at com.bea.alsb.console.test.actions.ServiceRequestAction.execute(ServiceRequestAction.java:143)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:97)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2044)
at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:91)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2116)
at com.bea.alsb.console.common.base.SBConsoleRequestProcessor.processActionPerform(SBConsoleRequestProcessor.java:91)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:556)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853)
at com.bea.alsb.console.common.base.SBConsoleRequestProcessor.process(SBConsoleRequestProcessor.java:191)
at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631)
at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158)
at com.bea.console.internal.ConsoleActionServlet.process(ConsoleActionServlet.java:256)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at com.bea.console.internal.ConsoleActionServlet.doGet(ConsoleActionServlet.java:133)
at com.bea.alsb.console.common.base.SBConsoleActionServlet.doGet(SBConsoleActionServlet.java:49)
at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1199)
at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1129)
at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:687)
at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.processActionInternal(ScopedContentCommonSupport.java:142)
at com.bea.portlet.adapter.scopedcontent.StrutsStubImpl.processAction(StrutsStubImpl.java:76)
at com.bea.portlet.adapter.NetuiActionHandler.raiseScopedAction(NetuiActionHandler.java:111)
at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:181)
at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:167)
at com.bea.netuix.servlets.controls.content.NetuiContent.handlePostbackData(NetuiContent.java:225)
at com.bea.netuix.nf.ControlLifecycle$2.visit(ControlLifecycle.java:180)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:324)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:130)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:395)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:352)
at com.bea.netuix.nf.Lifecycle.runInbound(Lifecycle.java:184)
at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:159)
at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:388)
at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:258)
at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:199)
at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:251)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.AsyncInitServlet.service(AsyncInitServlet.java:130)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)You need to open all the cursors in the PLSQL ie., cursors should be initialized in your PLSQL package. JCA DB Adapter tries to open the cursor without checking whether its there or not..If you cant change the PLSQL package, raise a SR with Oracle for a patch.This would be considered as Enhancement Request.
Regards
Sesha -
Taking control back while calling stored procedure using java programme
I have stored procedure to load data. This procedure is invoked by java program.
The stored procedure take around 10 to 15 minutes to do complete loading of database. I want to write stored procedure when it starts loading of database at the same return the control to calling java programme so that java program can do other operation i.e. java program can not wait for control back from stored procedure.
In short stored procedure runs in background and return control back to java program when stored procedure is invoked. Is it possible then How we can achieve this.U can acheive this using Java Threads. Create a thread submit this loading job. Once you submit the thread, you will get the control back to do other stuff.
Documentation:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html
-aijaz -
Facing syntax error while calling stored procedure
hi
iam calling a stored procedure which is a sybase USP.my code is as follows
clsm3=CommonLib.cnClient.prepareCall("{call SYB1103.SIFGSYS..USP_Ins_ShipmentInvLines_Tmp "+coid+",'"+invclass+"',"+newsysno+","+productcd+",'"+batchno+"',"+qty+","+productrate+","+assrate+","+expercent+","+examt+","+saleed+","+bonused+",'"+recby+"',"+linestat+","+brno+","+prinvno+","+invno+","+recno+"}");
clsm3.executeUpdate();
where clsm3 is an object of CallableStatement.but it is giving me a syntax error saying
"Invalid JDBC escape syntax at line position 84 '}' character expected"
please reply as soon as possibleclsm3=CommonLib.cnClient.prepareCall("{call
{call SYB1103.SIFGSYS..USP_Ins_ShipmentInvLines_Tmp
"+coid+",'"+invclass+"',"+newsysno+","+productcd+",'"+
batchno+"',"+qty+","+productrate+","+assrate+","+exper
cent+","+examt+","+saleed+","+bonused+",'"+recby+"',"+
linestat+","+brno+","+prinvno+","+invno+","+recno+"}")
;clsm3=CommonLib.cnClient.prepareCall("call <PROCEDURE_NAME>(?,?,?,....)
clsm3.setString(1,coid);
clsm3.setInt(2,invclass);
and so on...
Try the above. The syntax of the call is wrong in your code. -
Error While calling stored procedure with array
I am getting following error
java.sql.SQLException: Fail to construct descriptor: Invalid arguments
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:829)
at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:85)
at oracle.sql.STRUCT.toSTRUCT(STRUCT.java:322)
at oracle.jdbc.oracore.OracleTypeADT.toDatum(OracleTypeADT.java:253)
at oracle.jdbc.oracore.OracleTypeADT.toDatumArray(OracleTypeADT.java:296)
at oracle.jdbc.oracore.OracleTypeUPT.toDatumArray(OracleTypeUPT.java:137)
at oracle.sql.ArrayDescriptor.toOracleArray(ArrayDescriptor.java:750)
while executing following code
com.brocade.wwn.params.AuthParams ap = new com.brocade.wwn.params.AuthParams();
ap.setAuthKey("1");
ap.setAuthValue("1.1");
com.brocade.wwn.params.AuthParams ap1 = new com.brocade.wwn.params.AuthParams();
ap.setAuthKey("11");
ap.setAuthValue("1.11");
//com.brocade.wwn.params.AuthParams[] arrAP = new com.brocade.wwn.params.AuthParams[1];
//Object[] arrAP = new Object[1];
//arrAP[0] = ap;
com.brocade.wwn.params.AuthParams[] arrAP = {ap,ap1};
System.out.println(" >>> Creating Array Descriptor .... ");
oracle.sql.ArrayDescriptor arraydesc =
oracle.sql.ArrayDescriptor.createDescriptor("WWP.AUTH_ENTRIES", conn);
System.out.println (" ----> " + arraydesc.getBaseName());
System.out.println (" ----> " + arraydesc.getName());
System.out.println (" ----> " + arraydesc.getSQLName());
System.out.println (" ----> " + arraydesc.getSchemaName());
System.out.println (" ----> " + arraydesc.getTypeName());
System.out.println (" ----> " + arraydesc.getMaxLength());
System.out.println (" ----> " + arraydesc.getArrayType());
System.out.println ( arraydesc.TYPE_VARRAY + " : " + arraydesc.TYPE_NESTED_TABLE );
// Object[] tObj = arraydesc.toArray(arrAP);
//tObj = new String[2];
//tObj[0] = "sdaf";
//tObj[1] = "sdaf1";
// tObj[0] = ap;
System.out.println(" >>> Array Descriptor Created .... ");
oracle.sql.ARRAY array = new oracle.sql.ARRAY(arraydesc, conn, arrAP);
My database is Oracle 8i and I am using oracle 9i thin drivers.
Can anybody help me on this ....
thanksI am trying to pass parameter to test my procedure but it is giving this error : ORA-06531: Reference to uninitialized collection
ORA-06512: at line 12
Here is example for my test procedure:
declare
v_session_id_tab SESSION_ID_TAB_TYPE;
v_service_type_tab SERVICE_TYPE_TAB_TYPE ;
v_service_location_tab SERVICE_LOCATION_TAB_TYPE ;
v_service_call_name_tab SERVICE_CALL_NAME_TAB_TYPE;
v_service_call_start_time_tab SERVICE_CALL_ST_TAB_TYPE;
v_service_call_end_time_tab SERVICE_CALL_ET_TAB_TYPE;
v_service_call_duration_tab SERVICE_CALL_DUR_TAB_TYPE;
v_status_tab STATUS_TAB_TYPE;
v_notes_tab NOTES_TAB_TYPE;
begin
v_session_id_tab(1) := 1;
v_service_type_tab(1) := 'db';
v_service_location_tab(1) := 'local';
v_service_call_name_tab(1) := 'Name of call';
v_service_call_start_time_tab(1) := SYSDATE;
v_service_call_end_time_tab(1) := SYSDATE;
v_service_call_duration_tab(1) := 100;
v_status_tab(1) := 'Z';
v_notes_tab(1) := 'NOTES';
BULK_INSERTS (v_session_id_tab,v_service_type_tab, v_service_location_tab,v_service_call_name_tab,v_service_call_start_time_tab,v_service_call_end_time_tab,
v_service_call_duration_tab, v_status_tab, v_notes_tab);
end;
I declare all types at schema level.
Please give your comments.
Thank you -
Error when calling Stored Procedure from backing bean
I am using Jdeveloper 11.1.1.6 and am trying to utilize the following URL to execute a SP from a backing bean: http://ramannanda.blogspot.com/2011/11/optimized-update-insert-adf.html
The reason I am looking at this is currently I have coded my backing bean to perform inserts and deletes through the use of my View Objects. I am performing up to a combined 5-10K inserts and deletes and the performance is rather slow. If there is a way to tune the view objects as well as the commit to be much faster, that is the prefered method. If that can't be done then I would like to figure out the approach identified in the URL.
I have highlighted a section of code below that is failing when using the URL approach. It errors out with the following exception: javax.el.ELException: oracle.jbo.JboException: java.sql.SQLException: Internal Error: Inconsistent catalog view
Do you have thoughts as to what might cause this exception.
create or replace
type TYP_TEST_R is object
Test_Id Number(5,0) ,
Test_Num Number(7,0)
create or replace
type TYP_TEST_TB as table of TYP_TEST_R;
private void myMethod(MyTableVORowImpl pCurrentRow) {
int i = 0;
DCIteratorBinding lDciter =
(DCIteratorBinding)getBindings().get("MyTable1Iterator");
MyAppModuleAMImpl lMyAppModuleAMImpl =
(MyAppModuleAMImpl)lDciter.getViewObject().getApplicationModule();
Connection lConnection =
lMyAppModuleAMImpl.getDBTransaction().createStatement(1).getConnection();
StructDescriptor lTblRecordStructType =
StructDescriptor.createDescriptor("DBADMIN.TYP_TEST_R",
lConnection);
.....<additional logic here>......
Object lArray[] = new Object[lSortedDifferences.size()];
while (........) {
Number lNumber = .......
Number lDifferentStore = (Number)lDifferentIterator.next();
STRUCT lTempStruct =+_
new STRUCT(lTblRecordStructType, lConnection,+_
*new Object[] { pCurrentRow.getTestId(),*+_
lDifferentStore });+_
lArray[i] = lTempStruct;
i = i + 1;
//create array structure descriptor
ArrayDescriptor lTableDesc =
ArrayDescriptor.createDescriptor("DBADMIN.TYP_TEST_TB",
lConnection);
//create an Array type with given structure definition
ARRAY lTableArray =
new ARRAY(lTableDesc, lConnection, lArray);
String lCallableProcedureStatement =
" begin DBADMIN.SP_TEST(?,?); end;";
OracleCallableStatement lOracleCallableStatement = null;
lOracleCallableStatement =
(OracleCallableStatement)lMyAppModuleAMImpl.getDBTransaction().createCallableStatement(lCallableProcedureStatement,
0);
lOracleCallableStatement.setARRAY(1, lTableArray);
lOracleCallableStatement.setString(2,
(String)ADFUtil.evaluateEL("#{sessionScope['UserName']}"));
lOracleCallableStatement.executeUpdate();
}That was helpful and now I can execute up to my last line of code: "lOracleCallableStatement.executeUpdate();"
This code executes the SP.
My SP is as follows:
create or replace
PROCEDURE SP_TEST
*( param1 IN TYP_TEST_TB,*
param2 IN VARCHAR2) as
CURSOR for_insert_csr IS
SELECT *
FROM TABLE(param1) T1;
temp_update TYP_TEST_R;
BEGIN
FOR temp_update IN for_insert_csr
LOOP
-- do stuff in this loop
END LOOP;
end;
When trying to execute the SP, I get the following error:
+<LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5+
javax.el.ELException: oracle.jbo.JboException: java.sql.SQLException: ORA-06550: line 1, column 7:*
PLS-00201: identifier DBADMIN.SP_TEST must be declared*
ORA-06550: line 1, column 7:*
PL/SQL: Statement ignored*
at com.sun.el.parser.AstValue.invoke(Unknown Source)*
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)*
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1300)*
at oracle.adf.view.rich.component.UIXDialog.broadcast(UIXDialog.java:97)*
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)*
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)*
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)*
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)*
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)*
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)*
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)*
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)*
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)*
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1018)*
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:386)*
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)*
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)*
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)*
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)*
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)*
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)*
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)*
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)*
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)*
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)*
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)*
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)*
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)*
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)*
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)*
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)*
at java.security.AccessController.doPrivileged(Native Method)*
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)*
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)*
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)*
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)*
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)*
Do you have any suggestions on what I might want to try?
Maybe you are looking for
-
How do I get windows 8 on my iMac?
Ok, spent too long doing this. I have a windows 8 iso I got from dreamspark. Since my dvd drive is very unreliable, I burnt it with a USB one. I booted the dvd on a BIOS computer, and it worked. I also tried a different computer, a macbook pro, which
-
Netscape.javascript.ISObject ????
I'm new in Java so I don't know how to add any external classes to my Java environment. I've downloaded the ifc112 library, I have all sources, I defined the environment variable CLASSPATH but still when I write in code: import netscape.javascript.JS
-
I just installed My Airport Extreme and am having a bit of trouble managing it, with my Uverse service. I have read so much information on the topic and am unsure where to go. At present, everyone in my house has internet access and since my wife w
-
HT1338 Macbook 10.5.8 upgrade
I have Macbook version 10.5.8 and want to upgrade to Lion. What are the chances I will lose files/ passwords/apps once I re-upload?
-
How to execute the *.sql when using occi and vc
help me! i must to initialize the remote database using the file of sql, for example: the file is ss.sql; and it is "DECLARE row integer := 0; user varchar2(256); BEGIN user := '&1'; dbms_java.grant_policy_permission('PUBLIC', 'SYS', 'java.lang.Runti