PL/SQL Dynamic procedure call - arrays
I'm having a lot trouble dynamically calling procedures that have an array as a parameter value. It looks like it's not possible as I'm getting the deadly 'PLS-00707 unsupported construct or internal error [num]' message.
Is that true, that I can't pass an array in a dynamic procedure call?
The example procedure I'm calling is,
PROCEDURE test(pusr in NUMBER,
ptble IN VARCHAR2,
prprt IN VARCHAR2,
pccyy IN VARCHAR2,
parea IN VARCHAR2,
pregn IN VARCHAR2 DEFAULT null,
poffc IN VARCHAR2 DEFAULT null,
ptime IN VARCHAR2,
pmnth IN NUMBER DEFAULT null,
pqrtr IN NUMBER DEFAULT null,
prow IN VARCHAR2 DEFAULT null,
carray IN array_pcat)
If I call it like this it works fine.
uwsdm_web.test(pusr=> 100,
ptble=>'mic',
prprt=>'MIC3',
pccyy=>'1999',
parea=>'Statewide',
pregn=>'0',
poffc=>'0',
ptime=>'Year',
pmnth=>0,
pqrtr=>0,
prow=>'1,2,3,4',
parray=> carray);
where carray is the array.
If I change the carray to a value (numeric or character), I get a "PLS-00306: wrong number or types of arguments in call to 'TEST'" error. Efforts to pass multiple values also failed.
If I try to dynamically create the query and pass in the variable of carray, I run into similar problems because it's trying to allocate an array to one line of code.
Any suggestions?
Thanks.
Kurt
null
Apologizes for disturbing you,
as soon as I posted my question, I realized that there were some problems with the sintaxis I was using. Thank you very much and please excuse me for that silly question...
Miguel-Angel
Similar Messages
-
Actuate 7 PL/SQL Stored Procedure Call Before the Report Run.
Hi,
I need a small help to call a pl sql stored procedure in actuate 7.
I wrote a code a on component content
Function runProc(procName as String, connection As AcDBConnection )
' Insert your code here
Dim statement As AcDBStatement
Dim results as string
' Prepare statement
Set statement = connection.Prepare("BEGIN " & procName & "; END;" )
If statement Is Nothing Then
results = "Failed to prepare statement."
results = results & " " & connection.GetSpecificErrorText( )
results = results & " " & connection.GetGeneralErrorText( )
Exit sub
End If
' Execute sprocoutparam
If statement.Execute() = 0 Then
results = "Stored procedure " & procName & "execution failed."
results = results & " " & connection.GetSpecificErrorText( )
results = results & " " & connection.GetGeneralErrorText( )
Else
results = "Stored procedure " & procName & " execution success."
End if
ShowFactoryStatus(results)
End FunctionNow this Code I am calling on the Chart Start Method
Sub Start( )
Super::Start( )
' Insert your code here
Dim ProcName as String
Dim connectionObject As AcDBConnection
ProcName="DELETECUSTOMER(1234)"
runProc(ProcName, connectionObject )
End SubNow when i Run the Report i get this Error !
NewReportApp::Frame::Chart%Start(9): Invalid procedure reference. - (runProc)
1 Semantic Error(s) found
Thanks,
Asifhi,
Finally Figured Out Here....
Steps to Call the Stored Procedure In Actuate 7
1 – Right Click on Content – Frame and go to properties and method Tab.
1 – Click on New Button to you create own custom method.
2 – Write the following code :
Sub runProc(procName as String, connection As AcDBConnection )
Dim statement As AcDBStatement
Dim results as string
Set connection = GetConnection()
'Prepare statement
Set statement = connection.Prepare("BEGIN " & procName & "; END;" )
If statement Is Nothing Then
results = "Failed to prepare statement."
results = results & " " & connection.GetSpecificErrorText( )
results = results & " " & connection.GetGeneralErrorText( )
MsgBox "Procedure Not Called....Badddddd"
Exit sub
End If
' Execute sprocoutparam
If statement.Execute() = 0 Then
results = "Stored procedure " & procName & "execution failed."
results = results & " " & connection.GetSpecificErrorText( )
results = results & " " & connection.GetGeneralErrorText( )
MsgBox "Procedure Not Called....Badddddd" & results
Else
results = "Stored procedure " & procName & " execution success."
MsgBox "Procedure Called....Wowwww"
End if
ShowFactoryStatus(results)
End Sub2 – Now let call the stored procedure before our actual report query runs.
1 - Right Click on Content – Frame and go to properties and method Tab.
2 - Select the Start Method and Click on Override button.
3 - Write the following code:
Sub Start( )
Dim ProcName as String
Dim connectionObject As AcDBConnection
Set connectionObject = GetConnection()
ProcName="XXTEST ()"
runProc( ProcName, connectionObject )
Super::Start ( )
End Sub3 – Now design your report as usual using the Textual Query window. -
Dynamic SQL Stored Procedure call in Pro*C Application
Hello All
Could you help with a sample Pro*C program (or snippet) which has a dynamic call to a stored procedure? The procedure to be called is determined at run time and so also the number of parameters to it.
Is this even possible using Pro*C?
Thanks in Advance
RDHi Colin & Faust
We found sample pro*c programs for dynamically calling PL/SQL blocks but not for dynamically calling stored procedures.
Heres the program we compiled successfully but it doesnt work, it gives a core dump on execution. Could you point out whats wrong.
#include<stdio.h>
#include<iostream>
#include<fstream>
#include<stdlib.h>
#include<sqlca.h>
#include<string>
#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/msg.h>
#include<thread.h>
#include<sqlda.h>
#include<sqlcpr.h>
using namespace std;
#define TRUE 1
int main()
EXEC SQL BEGIN DECLARE SECTION;
char *UserID = getenv( "DATABASE" );
char query[100];
EXEC SQL END DECLARE SECTION;
SQLDA *bind_des;
EXEC SQL CONNECT :UserID;
EXEC SQL WHENEVER SQLERROR CONTINUE;
bind_des = SQLSQLDAAlloc( 0, 2, (size_t)10, (size_t)0 );
bind_des->N = 2;
strcpy( query, "CALL sel_dept( :empno,:name );");
//Calling stored procedure sel_dept( no NUMBER IN, name VARCHAR2 OUT)
EXEC SQL PREPARE sql_stmt from :query;
EXEC SQL DESCRIBE BIND VARIABLES FOR sql_stmt INTO bind_des;
bind_des->N = bind_des->F;
//cout << " bind_des->N after assigment = " << bind_des->N;
//--------------------- Enter the Input values -----------------------------
//parameter :1
bind_des->L[0] = 4;
/* Allocate storage for value and null terminator. */
bind_des->V[0] = (char *) malloc(bind_des->L[0] + 1);
/* Store value in bind descriptor. */
strcpy(bind_des->V[0], "50");
/* Set datatype to STRING. */
bind_des->T[0] = 2;
//parameter :2
bind_des->L[1] = 20;
/* Allocate storage for value and null terminator. */
bind_des->V[1] = (char *) malloc(bind_des->L[1] + 1);
/* Store value in bind descriptor. */
strcpy(bind_des->V[1], "");
/* Set datatype to STRING. */
bind_des->T[1] = 5;
EXEC SQL EXECUTE sql_stmt;
//cout<<"name"<<"\t"<bind_des->V[0]<<"\t"<<bind_des->V[1]<<endl;
cout << "name"<<"\t";
cout << "bind_des->V[0]=" << bind_des->V[0]<<"\t";
cout << "bind_des->V[1]=" << bind_des->V[1]<<"\t"<<endl;
for (int i = 0; i < bind_des->F; i++) /* for bind descriptor */
free(bind_des->V);
free(bind_des->I[i]);
SQLSQLDAFree(0, bind_des);
EXEC SQL COMMIT;
return 0; -
Calling SQL stored procedure dynamically
Hallo,
could anybody tell me how to call HANA SQL stored procedure dynamically?
The coding looks like this:
v_ProcedureName := '"' || KpiNamespace || '::' || KpiName || '"';
v_SQL := 'CALL ' || :v_ProcedureName || '( lt_outKPI )';
EXEC :v_SQL;
For this call I get the error message:
"Transaction rolled back by an internal error: wrong number or types of parameters in call: Physical table is not allowed in OUT table variable position: LT_OUTKPI: line 1 col 55 (at pos 54)"
The procedure to be called dynamically has a table output parameter.
Thanks in advance,
Best Regards,
Alexey Romanov.
Hi Alex,
Can you share your requirement on exactly what is the need to call the procedure dynamically?
For your question, have a look on the below:
1) Have a procedure named EMPLOYEE_DETAILS
http://scn.sap.com/servlet/JiveServlet/downloadImage/2-14895702-415799/236-170/pastedImage_0.png
2) Created one more procedure named Dynamically as shown below:
CREATE PROCEDURE Dynamically ()
AS
BEGIN
DECLARE QUERY VARCHAR(1000);
QUERY := 'call EMPLOYEE_DETIALS(?)';
EXECUTE IMMEDIATE (:QUERY);
END;
3) Output:
http://scn.sap.com/servlet/JiveServlet/downloadImage/2-14895702-415800/210-189/pastedImage_3.png
Regards,
Krishna Tangudu
Hi Krishna,
Thanks for your reply!
Unfortunately, I can neither go to ‘full discussion’, nor open the pictures, you have attached, nor see you reply.
That’s why I just add my reply to the problem description.
The procedure name is composed out of 2 parts on-the-fly, that is why I have to call it dynamically:
create local temporary table "#KPIEvals"(
"KpiNamespace" NVARCHAR(256) CS_STRING,
"KpiName" NVARCHAR(32) CS_STRING,
"KpiText" NVARCHAR(256) CS_STRING,
"Responsible" NVARCHAR(256) CS_STRING );
FOR cur_row as c_cursor DO
v_SQL := '';
v_ProcedureName := '"' || cur_row."KpiNamespace" || '::' || cur_row."KpiName" || '"';
v_SQL := 'CALL ' || :v_ProcedureName || '( lt_outKPI )';
EXEC :v_SQL;
v_SQL := 'INSERT INTO "#KPIEvals" SELECT * FROM :lt_out_kpi';
EXEC :v_SQL;
END FOR;
I guess there might be 2 reasons for the problem:
1. All the procedures are called dynamically in a loop.
2. All the procedures have an output parameter, which is a table.
Hope that helps,
Best Regards,
Alex.Hi Alexey, I think what you may need to do in this case is to do the insert into your temp table from within the dynamically called procedure, therefore no need for output param in your procedure call. You can then select from the temp table in your main procedure. Hope that makes sense.
Peter -
How to bind arrays to PL/SQL stored procedure using OCI?
Hi,
We are having problems trying to bind arrays to PL/SQL stored procedure using OCI. Here is the situation:
- We have a stored procedure called "GetVEPFindTasks" with the following interface:
PROCEDURE GetVEPFindTasks (
p_ErrorCode OUT NUMBER,
p_ErrorMsg OUT VARCHAR2,
p_RowCount OUT NUMBER,
p_VEPFindTasks OUT t_VEPFindTaskRecordTable,
p_MaxTask IN NUMBER);
t_VEPFindTaskRecordTable is a record with the following entries:
TYPE t_VEPFindTaskRecord IS RECORD (
RTCID NUMBER,
TransNum NUMBER,
TransTimestamp VARCHAR2(20),
Pathname1 image_data.pathname%TYPE,
Pathname2 image_data.pathname%TYPE,
Pathname3 image_data.pathname%TYPE,
OperatorID operator.id%TYPE);
- Now, we are trying to call the stored procedure from C++ using OCI (in UNIX). The call that we use are: OCIBindByName and OCIBindArrayOfStruct to bind the parameters to the corresponding buffers. We bind all parameters in the interface by name. Now, we do bind the record's individual item by name (RTCID, TransNum, etc.), and not as a record. I don't know if this is going to work. Then, we use the bind handles of the binded record items (only record items such as RTCID, TransNum, and NOT error_code which is not part of the record) to bind the arrays (using OCIBindArrayOfStruct).
All of the parameters that are binded as arrays are OUTPUT parameters. The rest are either INPUT or INPUT/OUTPUT parameters. Now, when we try to execute, OCI returns with an error "Invalid number or types of arguments" (or something to that sort... the number was something like ORA-06550). Please help...
Is there any sample on how to use the OCIBindArrayOfStruct with PL/SQL stored procedures? The sample provided from Oracle is only for a straight SQL statement.
Thank's for all your help.
** Dannil Chan **As you said:
You have to pass in an array for every field and deconstruct/construct the record in the procedure. There is no support for record type or an array of records. Can you give me a example? I'am very urgently need it.
thanks
email: [email protected] -
How to send a Varying Array param to a PL/SQL Stored Procedure from Java
* I am VERY new to jdbc, and even somewhat new to Java
* I'm using Java 1.5, Oracle 10g.
* I need to call the following PL/SQL Stored Procedure from Java:
procedure setEventStatus
i_deQueueStatus in deQueueStatus_type
*deQueueStatus_type is the following (an array of deQueueStatus_OBJ):
CREATE OR REPLACE TYPE deQueueStatus_OBJ as object
eventID number (20),
dequeuestatus varchar2(20)
CREATE OR REPLACE TYPE deQueueStatus_TYPE IS VARYING ARRAY(500) of deQueueStatus_obj
*I have created a Java object as follows:
public class EventQueueDeQueueStatus
long eventID;
String dequeueStatus;
EventQueueDeQueueStatus(long eventID, String dequeueStatus)
this.eventID = eventID;
this.dequeueStatus = dequeueStatus;
I have an ArrayList of these.
I need to pass this list to the Stored Procedure. How do I create a java.sql.Array so I can call CallableStatement.setArray to set the parameter? Or do I use something else? I have tried setObject with both the ArrayList and also with a primitive array, but got "Invalid Column Type" both times.
Any help would be greatly appreciated. I just got this task today, and I have to make it work by Tuesday :-( !
Thanks,
KathyKathy,
Search the archives of this forum and the JDBC forum for the terms STRUCT and ARRAY and you can find some sample code on the JDBC How-To Documents page and the JDBC Samples which can both be accessed from this page:
http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html
Good Luck,
Avi. -
External Procedure Call: Temporary Blob Array out.
Hello,
I am having difficulty getting out an array of blob from the external procedure call interface. I am trying to create an array of blob initialized with temporary blobs. I was successfully able to create single blob parameter out but no success with the array type.
I am including the code for PLSQL wrapper, test code, and the main C code.
I appreciate your help.
The error message of the test run:
0
10
DECLARE
ERROR at line 1:
ORA-22275: invalid LOB locator specified
ORA-06512: at "SYS.DBMS_LOB", line 554
ORA-06512: at line 7
CREATE OR REPLACE PROCEDURE blob_coll (
cintarray IN OUT VDC_BLOB_ARRAY ) IS
LANGUAGE C
NAME "blob_coll"
LIBRARY sjc_lib WITH CONTEXT
PARAMETERS (
context,
cintarray OCIColl);
DECLARE
BLOBARRAY VDC_BLOB_ARRAY:= VDC_BLOB_ARRAY();
BEGIN
dbms_output.put_line( BLOBARRAY.count);
SCOTT.BLOB_COLL ( BLOBARRAY );
dbms_output.put_line( BLOBARRAY.count);
dbms_output.put_line( dbms_lob.getlength( BLOBARRAY(1)));
END;
void blob_coll( OCIExtProcContext *ctx,
OCIColl **cintarray )
sword status;
int i;
OCILobLocator *lobp[10];
status = OCIExtProcGetEnv( (OCIExtProcContext *)ctx, (OCIEnv **)&envhp,
(OCISvcCtx **)&svchp, (OCIError **)&errhp );
for (i=0; i < 10; i++)
status=OCIDescriptorAlloc( (dvoid *)envhp, (dvoid **) &lobp,
(ub4)OCI_DTYPE_LOB, (size_t)0, (dvoid**)0);
status=OCILobCreateTemporary((dvoid *)svchp,
(dvoid *)envhp,
lobp[i], (ub2)0, SQLCS_IMPLICIT,
OCI_TEMP_BLOB, OCI_ATTR_CACHE,
OCI_DURATION_SESSION);
status = OCICollAppend( (OCIEnv *)envhp,(OCIError *)errhp,
(CONST dvoid*) lobp[i],
(CONST dvoid*)0,
(OCIColl *)*cintarray);The "X" in the second registerOutParameter is the type name which
you have created in oracle DB.
eg. if you have created a nested table
create Type integer_table is table of number(10);
then "X" = "INTEGER_TABLE" and it has to be in caps
and other thing to keep in mind is that it only works with nested
table or varray and not with pl/sql table.
Al Pivonka (guest) wrote:
: How can I pass pl/sql record in and out
: and pl/sql tables in out thru a pl/sql procedure using jdbc
with
: the zip file of 816classes12.zip...
: I have tried everything I know...
: I know the procedure is working, others are using it with in
: Oracle...
: I need to use the information it generates.
: here is what I have so far...
: try
: Class.forName ("oracle.jdbc.driver.OracleDriver");
: DriverManager.registerDriver (new
: oracle.jdbc.driver.OracleDriver());
: oracle.jdbc.driver.OracleConnection conn =
: (oracle.jdbc.driver.OracleConnection
: DriverManager.getConnection
("jdbc:oracle:thin:@--","NA","NA");
: // SQL92 SyntaxCallableStatement
: oracle.jdbc.driver.OracleCallableStatement cstmt =
: (oracle.jdbc.driver.OracleCallableStatement)conn.prepareCall
: ("{call cbmd_proposal_PKG.DefaultTerms (?,?,?,?)}" ) ;
: cstmt.setString(1,"5118");
: cstmt.setString(2,"3");
: cstmt.registerOutParameter
: (2,oracle.jdbc.driver.OracleTypes.NUMBER);
: cstmt.registerOutParameter
(1,oracle.jdbc.driver.OracleTypes.ARRAY,"X");
: cstmt.execute();
: catch(Exception e)
: System.err.println(e.toString());
: e.printStackTrace();
: The "X" in the second registerOutParameter is still unknown to
: me.
: The JavaDoc for the
OracleCallableStatement.registerOutParameter
: is not clear.
: Can any One help simplify this...
: Thanks
null -
How to write a PL/SQL stored procedure in Oracle to call Webservice
Can any one pelase send me a code on how to write a PL/SQL stored procedure in Oracle database to call the Webservice ?
Thanks,
RajeshWere you able to solve this problem
-
How to call pl/sql stored procedure in JDBC query dialogbox
Hi,
how to call pl/sql stored procedure in JDBC query dialogbox(reports 9i) .
Cheers,
Raghuplease refer : Re: problem If you have more doubts, please ask in that question.
-
Multiple procedure calls in a dynamic command
The point of grouping procedures calls in the same command was to reduce network traffic and improve performance.
I am trying to convert this dynamic command that works with MSSQL :
sprintf(strcmd,"execute MyProc '%s' execute %s '%s'",arg1,dynproc,arg1);
Is there a way to translate this command to Oracle ODBC ?
I tried things like {Call MyProc '%s'}{Call %s('%s')} but it does not work.
Thanks in advance for any help.
nullHave you tried executing the second procedure from within the first? It looks reasonable since they both have the same args.
TKW
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Pascale Lacroix ([email protected]):
The point of grouping procedures calls in the same command was to reduce network traffic and improve performance.
I am trying to convert this dynamic command that works with MSSQL :
sprintf(strcmd,"execute MyProc '%s' execute %s '%s'",arg1,dynproc,arg1);
Is there a way to translate this command to Oracle ODBC ?
I tried things like {Call MyProc '%s'}{Call %s('%s')} but it does not work.
Thanks in advance for any help.
<HR></BLOCKQUOTE>
null -
How to call PL/SQL stored procedure using ODBC?
Could anyone tell me how can I call PL/SQL stored procedure using
ODBC? Are there any sample codes?
Thanx!
nullYou are correct on all counts, they all should work.
Oracle Product Development Team wrote:
: Hi,
: I don't know the exact syntax in ODBC, but reasoning by analogy
: with other API's, I'd bet one of the following works
: (for a call to: procedure my_proc(n1 number, n2 number);):
: "{ my_proc(1,2); }"
: "{ call my_proc(1,2); }"
: "{ begin my_proc(1,2); end }"
: "begin my_proc(1,2); end;"
: "begin my_proc(1,2); end"
: Hope this helps. - Pierre
: jiangbuf (guest) wrote:
: : Could anyone tell me how can I call PL/SQL stored procedure
: using
: : ODBC? Are there any sample codes?
: : Thanx!
: Oracle Technology Network
: http://technet.oracle.com
null -
How to call PL-SQL/stored procedure in Creator
Anybody can tell how to call PL-SQL/Stored procedures inside creator...
Hi!!!
You can see this topic http://forum.sun.com/jive/thread.jspa?threadID=106046
There is how to call oracle stored procedures. Also I put a lot of links in these topic doing reference stored procedures. I have one that it tells specially how to call oracle stored procedures from java, is in spanish but you can understand the code.;-)
http://yoprogramador.vampisol.com/index.php?title=pl_sql_oracle_desde_java&more=1&c=1&tb=1&pb=1
Byeee -
Function and procedure call overhead in PL/SQL
( I come from a programming background - java/c++ etc and not much PL/SQL )
Im trying to get a feel of how much extra cycles are spent if something is wrapped inside a function or procedure. I mean will it become considerably inefficient if the logic is within a function as opposed to be directly inline ?I did some timings a few years ago and found procedure calls to be slightly more efficient than function calls, presumably due to the fact that functions must pass values back through the function invocation and procedures don't. This may have changed in more recent releases but you can check it yourself.
Set up a function and a procedure and use dbms_utility to get a starting and ending time marker (this will be the number of seconds from an arbitrary start point as microseconds; you will have to convert). Get a start time, loop through the calls a lot of times, get and end time, and subtract the end time from the start time.
The prevailing though is that use functions to return values and procedures to perform actions. You can use functions in SQL if written correctly but not procedures. -
Sql server configuration manager remote procedure call failed(0x800706be)
Hi,
My Sql Server Management Studio working well. But When I open Sql server configuration manager I Got an error
“Remote procedure call failed (0x800706be)”
I tried Goggling the problem and solve it but I am not getting any valuable
solution. Is anyone solve this problem
I attach snap here
MySql Server Details:
Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (X64) Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )This error appears to happen when .mof files (Managed Object Format (MOF)) don’t get installed and registered correctly during set-up. To resolve this issue, I executed
the following mofcomp command in command prompt to re-register the *.mof files:
mofcomp.exe "C:\Program Files (x86)\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof"
Regards,
Basit A. Farooq (MSC Computing, MCITP SQL Server 2005 & 2008, MCDBA SQL Server 2000)
http://basitaalishan.com
cau u pls tell me how to type this command on command prompt. I also have the same error in sql server 2008. I allready have sql server 2008 sp2 installed. When I was trying to type this command as it it by copying this full command to command prompt it
shows that command not found as follows
C:\>mofcomp.exe "C:\Program Files (x86)\Microsoft SQL Server\100\Shared\sqlmgmpr
oviderxpsp2up.mof"
Microsoft (R) MOF Compiler Version 6.1.7600.16385
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
File 'C:\Program Files (x86)\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2
up.mof' not found!
please tell me step by step
thanks
nravhad -
Error calling PL/SQL stored procedure
Hi,
I'm pretty new to JDeveloper having used NetBeans for the last few years.
I'm getting an error when trying to call a PL/SQL stored procedure. When I click on any of the oracle errors I get an "unable to find source file" message. The errors occurs in call.execute(). The error message and Java code are listed below. Any help is much appreciated.
Cheers,
Stevie
Errors:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 33
at java.lang.String.charAt(String.java:558)
at oracle.jdbc.driver.OracleSql.handleODBC(OracleSql.java:877)
at oracle.jdbc.driver.OracleSql.parse(OracleSql.java:811)
at oracle.jdbc.driver.OracleSql.getSql(OracleSql.java:284)
at oracle.jdbc.driver.OracleSql.getSqlBytes(OracleSql.java:538)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:169)
at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:873)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1161)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3001)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3093)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4286)
at oracle.CallPLSQL.callLMO(CallPLSQL.java:118)
at oracle.TestHarness.main(TestHarness.java:18)
Jave Code:
package oracle;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Types;
public class CallPLSQL {
private Connection conn;
public CallPLSQL() {
*Constructor.
try {
//Register Oracle Database Drive
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
//set connection
String connectionString="jdbc:oracle:thin:TSD/TSD@DEV:1526:DEVELOP";
this.setConn(DriverManager.getConnection(connectionString,"TSD", "TSD"));
} catch (SQLException ex) {
public int callproc () throws SQLException {
CallableStatement call;
String callString = "{call proc" +
call = conn.prepareCall(callString);
call.setInt(1, 120289);
call.setInt(2, 2008);
call.registerOutParameter(3, Types.INTEGER);
call.registerOutParameter(4, Types.INTEGER);
call.registerOutParameter(5, Types.INTEGER);
call.registerOutParameter(6, Types.DATE);
call.registerOutParameter(7, Types.VARCHAR);
call.registerOutParameter(8, Types.INTEGER);
call.registerOutParameter(9, Types.INTEGER);
call.execute();
int i = call.getInt("app_id");
return i;
public void setConn(Connection conn) {
this.conn = conn;
public Connection getConn() {
return conn;
}I've fixed it now. I'd missed a } in prepareCall. What a doughball.
Maybe you are looking for
-
Hi, there are many queries my one of my packages, which has the SQL as follows: Update table XYZ Set Column A = NULL Where Colum B IS NOT NULL; Column B has NUMBER datatype. Due to 'IS NOT NULL' the index (existing for Column B' is not being used in
-
Weird "speed brake" on Mac Mini 2009 with Lion
Hi all, this is bizarre: I have a Mac Mini from 2009 running Lion (with server). For weeks (months?), it's been incredibly slow, spinning beachball of death and all. When I look at the Disk Activity pane of Activity Monitor, for example when starting
-
How to change the worklist in schedule manager in production system
we are using schedule manager (SCMA) to arrange the daily process in SAP system. but we have to config the worklist and transport it to the production system every time cause in production system if we press edit worklist there would be a message cal
-
How do I delete large amounts of photos from my ipad?
a
-
Severe problem with 'Drill to Related' using drill icon
Hi I have a severe problem with 'Drill to Related' in Discoverer Plus (10.1.2.54.25) using the drill icon of a worksheet: 1. Though existing no items to drill to are shown in the context menu (or pop-up list), instead it says just 'Drill to Related..