Problem calling Oracle10g stored procedure (bug?)
Hello everybody, I am trying to call a stored procedure Oracle on Oracle 10g XE from Java.
I can succesfully execute query from Java, so I can say that driver, connection, ... are all right.
I have the following error when I try to call a stored procedure or a function.
I think that it is a bug of the file OraClient10.Dll, so, in general, a bug that don't depends from my code. So I install the most recent version of JDK/JRE, and I download again file OraClient10.Dll but result was the same.
Please help me!
Thank you
Ulix
# A fatal error has been detected by the Java Runtime Environment:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x61d37460, pid=3872, tid=1224
# JRE version: 6.0_16-b01
# Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode windows-x86 )
# Problematic frame:
# C [OraClient10.Dll+0x117460]
# An error report file with more information is saved as:
# If you would like to submit a bug report, please visit:
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Why not just connect via the thin mode of the driver, not the oci mode?
You'll get all the functionality and none of the native code bug risk.
Similar Messages
-
Problem Calling Oracle Stored Procedure From JAVA
Hello all. I've been banging my head against this all day:
Here's the procedure I'm calling:
GetIDsByLatLonRadius(inLatitude IN NUMBER,
inLongitude IN NUMBER,
inRadius IN NUMBER,
inTableName IN VARCHAR2,
inIDColName IN VARCHAR2,
inLatColName IN VARCHAR2,
inLonColName IN VARCHAR2,
LocationIDs OUT HomesCom_Types.GenericCursorType,
ErrorNo OUT VARCHAR2);
And here's the JAVA code:
public Hashtable GetInRadius(Hashtable inStruct)
ResultSet locationIDs = null;
Hashtable outputHash = new Hashtable();
float latitude = (float) 30.429;
float longitude = (float) -84.2585;
float radius = (float) 10;
try {
CallableStatement proc = con.prepareCall("{ call GEOCODING.getidsbylatlonradius(?,?,?,?,?,?,?,?,?) }");
proc.setFloat(1,latitude);
proc.setFloat(2,longitude);
proc.setFloat(3,radius);
proc.setString(4,"demographics_school");
proc.setString(5,"onboard_id");
proc.setString(6,"geocoding_latitude");
proc.setString(7,"geocoding_longitude");
proc.registerOutParameter(8,OracleTypes.CURSOR);
proc.registerOutParameter(9,OracleTypes.VARCHAR);
proc.execute();
locationIDs = (ResultSet) proc.getObject(1);
if (locationIDs != null)
outputHash.put("query",locationIDs);
else
outputHash.put("query","LOCATION ID WAS NULL");
catch(SQLException sqlException) {
System.out.println(
"The following error occured in reading " +
"from the table: "
+ sqlException);
outputHash.put("error",sqlException.getMessage());
return outputHash;
This catches and the sqlException I get is: Unhandled sql type
I'm not a java expert and I'm completely stuck at this point, so I figured a few more eyes on it might help.
Thanks in advance,
DannyDanny,
Don't print merely the error message, print the whole stack trace.
Then post it here.
What java version are you using?
What JDBC driver and version are you using?
What Oracle database version are you using?
Is the code from a Java ServerPages (JSP) or from a Java Stored Procedure (JSP)?
I guess "HomesCom_Types" is one of your PL/SQL packages or routines, right?
If so, then you can't use it in JDBC, you must define a database type using the command:
create or replace type ...But in later versions of the Oracle database, the REF CURSOR type is built-in.
Check the Oracle documentation for more details.
Good Luck,
Avi. -
Problem Calling MaxDB stored procedure with output from MII Query template
Hi,
I am using Max DB Database studio to write stored procedure, I am calling stored procedure from MII Query using CALL statement.
Can anyone guide me how to pass output values of stored procedure.
Examlpe::
call ProcName('[Param.1]','[Param.2]','[Param.3]','[Param.4]','[Param.5]', :isSuccess, :Trace)
In the above line of code I am not able to get the output values of stored procedure that is isSuccess and Trace values in Query template when executed. But same thing I get when executed in Database studio.
How do I call with outputs for any stored procedure in MII.
Any help would be appriciated.
Thanks,
PadmaMy call statement is like this
call RESULTDATA_INSERT('[Param.1]','[Param.2]','[Param.3]', :isSuccess, :Trace)
I am able to insert record in DB, But I am not getting output values in Query template.I have done this in Fixed Query, when I execute it throws me "Fatal error as Loaded content empty".
I tried giving select below call but it dont work.
Regards,
Rao -
Problem with JDBC results calling simple stored procedure in VC 7.0
Hi all,
I am building a simple VC model which calls a stored procedure on a JDBC database. I have created the system in the portal, defined the alias and user mapping, the connection test is fine and the VC "find data" lists my bespoke stored procedure.
The stored procedure is :
CREATE PROCEDURE dbo.dt_getBieUsers
AS
select * from dbo.emailuserlink
GO
When I test it using query analyser, it returns 3 records each with the two fields I expect - user and email address.
I drag the model onto the workspace in VC and create an input form ( with just a submit button ). i drag the result port out to create a table. This has no fields in it.
I build and deploy as flex and the app runs, I click the submit button and SUCCESS! I get 3 records in my table each with 2 fields. The data is all correct. The problem with this is the fields are determined at runtime it seems.
I go back to the table and add 2 columns "email" and "address".
i build and deploy and run the app. Again I get 3 records, but this time the contents of all of the rows is not data, but "email" and "address". The data has been replaced by the header texts in all of the rows.
Can anyone help? Why isn't the data being put in my columns as I would expect?
I tried to build and deploy the app as Web Dynpro rather than Flex to see if it was a bug in Flex. The application starts but when I click the submit button to run the JDBC stored procedure I get a 500 Internal Server Error
com.sap.tc.wd4vc.intapi.info.exception.WD4VCRuntimeException: No configuration is defined for the entry JDBCFunction
at com.sap.tc.wd4vc.xglengine.XGLEngine.createComponentInternal(XGLEngine.java:559)
at com.sap.tc.wd4vc.xglengine.XGLEngine.getCompInstanceFromUsage(XGLEngine.java:362)
at com.sap.tc.wd4vc.xglengine.XGLEngine.getCompInstance(XGLEngine.java:329)
at com.sap.tc.wd4vc.xglengine.wdp.InternalXGLEngine.getCompInstance(InternalXGLEngine.java:167)
at com.sap.tc.wd4vc.xglengine.XGLEngineInterface.getCompInstance(XGLEngineInterface.java:165)
The JDBC connection I am using has a connection URL of jdbc:sap:sqlserver://localhost;DatabaseName=BIEUSERS
and a driver class of com.sap.portals.jdbc.sqlserver.SQLServerDriver
Can anyone solve my wierd problems?
Cheers
RichardHi Richard,
After you drag and drop the data service, right click on it and choose "Test data service". Then click on "Execute" and after you see the result on the right, click on "Add fields" button (inside the same window). Now you'll see that the fields are on the tabel. This is required only for JDBC data services, since this data (how the resultset is built) is not know in DT and it needs to be run firest - then analysed and only then you have to add the fields to the table).
Regards,
Natty -
Formatted Search calling a stored procedure
Hello all,
I am having a problem getting a formatted search to work when I call a stored procedure from SAP (I am doing this because of a bug we discovered and need to get the client live Feb 1). The stored procedure works fine when passing variables from within SQL Server, but fails when using SAP. The problem seems to be where I need to get a UDF from the item master table, but not sure. Thanks in advance
The call from SAP query is:
declare @LineType as varchar(6)
declare @Width as numeric (19,6)
declare @LI as numeric (19,6)
declare @LN as numeric (19,6)
declare @LD as numeric (19,6)
declare @HI as numeric (19,6)
declare @HN as numeric (19,6)
declare @HD as numeric (19,6)
declare @QtyOrd as numeric (19,6)
Select @Width = $[OITM.U_WTH]
FROM OITM
WHERE OITM.ItemCode = $[$38.1]
exec TBC_CHOP
@Width,
@LineType = $[$38.U_LINETYPE],
@LI =$[$38.U_LI],
@LN =$[$38.U_LN],
@LD =$[$38.U_LD],
@HI = $[$38.U_HI],
@HN = $[$38.U_HN],
@HD = $[$38.U_HD],
@QtyOrd = $[$38.U_QTYORD]
The stored procedure is:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
-- =============================================
-- Author: <Mark Rueff
-- Create date: <Jan 5, 2009>
-- Description: <Chop Calculation>
-- =============================================
ALTER PROCEDURE [dbo].[TBC_Chop]
-- Add the parameters for the stored procedure here
@LineType AS varchar(6) ,
@Width AS numeric(19, 6),
@LI AS numeric(19, 6) ,
@LN AS numeric(19, 6),
@LD AS numeric(19, 6),
@HI AS numeric(19, 6),
@HN AS numeric(19, 6),
@HD AS numeric(19, 6) ,
@QtyOrd AS numeric(19,6)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT
CASE
WHEN @LineType = 'c' AND @Width >= 3
THEN ROUND((((ROUND((((@Width * 10) + 5) / 10), 1) * 8) + (((@LI + (@LN / @LD)) + (@HI + (@HN / @HD))) * 2) + 4) / 12) * @QtyOrd, 1)
WHEN @LineType = 'c' AND @Width < 3
THEN
CASE
WHEN RIGHT(CONVERT(int,(@Width * 10)), 1) > 0 AND RIGHT(CONVERT(int, (@Width * 10)), 1) < 5
THEN ROUND(((((ROUND((@Width - 0.5), 0) + 0.5 * 8) + (((@LI + (@LN / @LD)) + (@HI + (@HN / @HD))) * 2) + 4) / 12) * @QtyOrd), 1)
ELSE ROUND((((ROUND(@Width, 0) * 8) + (((@LI + (@LN / @LD)) + (@HI + (@HN / @HD))) * 2) + 4) / 12) * @QtyOrd, 1)
END
WHEN @LineType = 'j' AND @Width >= 3
THEN ROUND((((ROUND((((@Width * 10) + 5) / 10), 1) * 8) + (((@LI + (@LN / @LD)) + (@HI + (@HN / @HD))) * 2) + 4) / 12) * @QtyOrd, 1)
WHEN @LineType = 'j' AND @Width < 3
THEN
CASE
WHEN RIGHT(CONVERT(int, (@Width * 10)), 1) > 0 AND RIGHT(CONVERT(int, (@Width * 10)), 1) < 5
THEN ROUND(((((ROUND((@Width - 0.5), 0) + 0.5 * 8) + (((@LI + (@LN / @LD)) + (@HI + (@HN / @HD))) * 2) + 4) / 12) * @QtyOrd), 1)
ELSE ROUND((((ROUND(@Width, 0) * 8) + (((@LI + (@LN / @LD)) + (@HI + (@HN / @HD))) * 2) + 4) / 12) * @QtyOrd, 1)
END
WHEN @LineType = 'r'
THEN ROUND(((((@Width * 2) + (@LI + (@LN / @LD))) / 12) * @QtyOrd), 1)
WHEN @LineType = 's'
THEN @QtyOrd * 1.5
WHEN @LineType = 'o'
THEN @QtyOrd
WHEN @LineType = 'l'
THEN @QtyOrd
ELSE 0
END
ENDMark,
I believe the syntax of your formatted search is not right. I guess you are trying to get the U_Width from Item Master and the other values from the current form.
SELECT @Width = T0.U_WTH FROM [dbo].[OITM] T0.WHERE T0.ItemCode = $[$38.1.0]
EXEC TBC_CHOP @Width, $[$38.U_LINETYPE.0], $[$38.U_LI.0], $[$38.U_LN.0],
$[$38.U_LD.0], $[$38.U_HI.0], $[$38.U_HN.0], $[$38.U_HD.0], $[$38.U_QTYORD.Number]
If you see I have added a third parameter which is the Type to the formatted seach field selection $[$Item.Column.Type]
I have made then all 0 but you may change it as per the col type. This Type should be 0 for Char type columns, Number for numeric columns and Date for Date type cols
Suda -
Error while calling a stored procedure with OUT parameter.
Hi,
I am trying to call a Stored Procedure(SP) with an OUT parameter(Ref Cursor) from a third party tool. It is called using OLE-DB Data provider. In one database the procedure works fine but when I change the database the procedure call is giving following error.
Distribution Object: COM Error. COM Source: OraOLEDB. COM Error message: IDispatch error #3092. COM Description: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'TEST1'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored.
I am not able to find as to why is this happening. Please let me know any clues /help to solve this problem.
Thanks in advance.If you're using Oracle Provider for OLE DB (OraOLEDB) to execute this stored procedure, you need to set PLSQLRSet attribute. This attribute can be set in registry, connection string, or command object. Please refer to User Documentation for more information.
-
With JDBC, calling a stored procedure with ARRAY as out parameter
Hi,
I want to use the data type ARRAY as an out parameter in an Oracle stored procedure. I want to call the stored procedure from
my java program using JDBC.
The problem it's i use a 8.1.7 client to acces with oci to a 7.1.3 Database.
With this configuration I can get back a Cursor but not an Array.
Does it's possible ?
Thanks for your help !
MichaklOriginally posted by JDBC Development Team:
It's very similar to other datatype except that it uses OracleTypes.ARRAY typecode and the value is mapped to a oracle.sql.ARRAY instance. The code looks as follows --
cstmt.registerOutParameter (idx, OracleTypes.ARRAY, "VARRAY_TYPE_NAME_HERE");
cstmt.execute ();
ARRAY array = (ARRAY) cstmt.getObject (idx);
Thanks for your reply.
I have to use:-
OracleCallableStatement cs1 = (OracleCallableStatement )conn.prepareCall
( "{call proj_array(?)}" ) ;
for retrieving a collection as an OUT parameter.
This gives me the errors:-
C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Blob getBlob(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
import java.sql.*;
^
C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Array getArray(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
import java.sql.*;
^
C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Clob getClob(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
import java.sql.*;
^
C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Ref getRef(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
import java.sql.*;
^
How do I get rid of these errors?
null -
Ssrs 2008 r2 report dataset call a stored procedure
I am modifying an existing SSRS 2008 r2 report. In a dataset that already exists within the ssrs 2008 r2 report I need execute
a stored procedure called StudentData and pass 3 parameter values to the stored procedure. The stored procedure will then return 5 values that are now needed for the modified ssrs report. My problem is I do not know how to have the dataset call the stored procedure
with the 3 parameter values and pass back the 5 different unique data values that I am looking for.
The basic dataset is the following:
SELECT SchoolNumber,
SchoolName,
StudentNumber,
from [Trans].[dbo].[Student]
order by SchoolNumber,
SchoolName,
StudentNumber
I basically want to pass the 3 parameters of SchoolNumber, SchoolName, and StudentNumber to the
stored procedure called StudentData from the data I obtain from the [Trans].[dbo].[Student]. The 3 parameter values will be obtained from the sql listed above.
The columns that I need from the stored procedure called StudentData will return the following data columns
that I need for the report: StudnentName, StudentAddress, Studentbirthdate, StudentPhoneNumber, GuardianName.
Thus can you show me how to setup the sql to meet this requirement I have?Hi wendy,
After testing the issue in my local environment, we can refer to the following steps to achieve your requirement:
Create three multiple parameters named SchoolNumber, SchoolName and StudentNumber in the report. Those available values from the basic dataset SchoolNumber, SchoolName and StudentNumber fields.
If you want to pass multiple values parameter to stored procedure, we should create a function as below to the database:
CREATE FUNCTION SplitParameterValues (@InputString NVARCHAR(max), @SplitChar VARCHAR(5))
RETURNS @ValuesList TABLE
param NVARCHAR(255)
AS
BEGIN
DECLARE @ListValue NVARCHAR(max)
SET @InputString = @InputString + @SplitChar
WHILE @InputString!= @SplitChar
BEGIN
SELECT @ListValue = SUBSTRING(@InputString , 1, (CHARINDEX(@SplitChar, @InputString)-1))
IF (CHARINDEX(@SplitChar, @InputString) + len(@SplitChar))>(LEN(@InputString))
BEGIN
SET @InputString=@SplitChar
END
ELSE
BEGIN
SELECT @InputString = SUBSTRING(@InputString, (CHARINDEX(@SplitChar, @InputString) + len(@SplitChar)) , LEN(@InputString)-(CHARINDEX(@SplitChar, @InputString)+ len(@SplitChar)-1) )
END
INSERT INTO @ValuesList VALUES( @ListValue)
END
RETURN
END
Use the query below to create a stored procedure, then use it to create a dataset to return 5 values:
create proc proc_test(@SchoolNumber nvarchar(50),@SchoolName nvarchar(50),@StudentNumber nvarchar(50))
as
begin
select StudnentName, StudentAddress, Studentbirthdate, StudentPhoneNumber, GuardianName
from table7 where SchoolNumber in (SELECT * FROM SplitParameterValues (@SchoolNumber,',')) and SchoolName in(SELECT * FROM SplitParameterValues (@SchoolName,',')) and StudentNumber in (SELECT * FROM SplitParameterValues (@StudentNumber,','))
end
Right-click the new dataset to modify the parameter value in the Parameters pane as below:
=join(Parameters!SchoolNumber.Value,",")
=join(Parameters!SchoolName.Value,",")
=join(Parameters!StudentNumber.Value,",")
For more details about pass multi-value to stored procedure, please see:
http://munishbansal.wordpress.com/2008/12/29/passing-multi-value-parameter-in-stored-procedure-ssrs-report/
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support -
How to call Packaged Stored Procedure in JDBC Adapter?
hello frnds,
I m working on a SAP R/3 -> XI -> Oracle scenario. Here on receiver side i m using JDBC Adapter in which i m using a stored procedure.
I have my stored procedure in a Package. Example : package "PKG_SPARES_VOR_UPLOAD" and in that stored procedure "pr_spares_vor_po_hdr_upload".
i have checked that if i write this stored procedure outside the package then it works fine... but if i put it into the package then it is giving me error that ....
" Receiver Adapter v2112 for Party '', Service 'BS_ORADEV':
Configured at 2006-08-16 10:12:14 GMT+05:30
History:
- 2006-08-16 11:02:04 GMT+05:30: Error: TransformException error in xml processor class: Error processing request in sax parser: Error when executing statement for table/stored proc. 'PR_SPARES_VOR_PO_HDR_UPLOAD' (structure 'statement'): java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00201: identifier 'PR_SPARES_VOR_PO_HDR_UPLOAD' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored ".
please help me out with this problem.
Thankx,
Regards,
AudumbarHi,
I have the same problem to call a stored Procedure in a Package.
If my procedure is not in a package, everything is right.
And I musn't indicate all the name, because I musn't put '.' in the name (of the procedure), in my DT on XI.
It would be so nice to have an answer.
Rémi -
Calling a stored procedure from a url
I am needing to call a stored procedure from a url string (or
anchor) understand that from training to be as follows:
http://host:port/pls/dad/package.procedure?query_string
With that in mind, I am getting an error as follows:
Not Found
The requested URL /pls/portal30/at_hrfm.checkshow.showcheck was
not found on this server.
Here is a sample of my url
http://servername:port/pls/portal30/at_hrfm.checkshow.showcheck
I can see servername:port/pls/portal30, it is just the
procedure I am having a problem with.
Here is a sample of my source code that is created under the
at_hrfm schema (I also tried under portal30 schema).
package body checkshow as
procedure showcheck as
begin
htp.htmlOpen;
htp.headOpen;
htp.title('My Check');
htp.comment ('This should be your Check');
htp.bodyOpen;
htp.header (1,'Check');
htp.print ('checkdate');
htp.bodyClose;
htp.headClose;
htp.htmlClose;
end;
end;I think I figured this out. I don't think the grant to ANONYMOUS is going to work with production XE and the online documentation is in need of an update. It appears that production XE has been locked down and you will need to specify the name of each stored procedure you wish to allow to be executed by adding it to the WWV_FLOW_EPG_INCLUDE_MOD_LOCAL function. This is spelled out in more technical detail here: http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/adm_wrkspc.htm#BEJCGJFJ
Another alternative that would work involves creating a separate DAD. Using the DAD approach with my schema made all of my stored procedures callable from a web browser, so I rejected this approach. To make this usable (secure) I would have needed to create and maintain a separate database user for the DAD and then only granted it execute for the stored procedures I wanted to be callable from a URL.
Finally I read about using an on-demand procedure and having it invoke the desired stored procedure. While I didn't try this out, it sounds like another good approach because it maintains session security. If it can be used to return an image I do not know.
- Jim -
Calling a stored procedure with a CLOB as input parameter
Hello,
I was unsuccessfully trying to call a stored procedure with a clob as input parameter from my C++ application using occi.
Anyone got a working example to look at?
I already checked the thread Invalid OCI handle when creating a Blob which didn't help.
The problem seems to be that I don't have a lob locator to write my data (xml file) to. I tried creating a temporary clob using the sys.dbms_lob package which only resulted in a major headache on my part...
I would appreciate any help.
Kind regards
Horst
my environment:
Visual Studio 2008, C++ application
Oracle 11gTo start using a blob you have to insert it into the database and then get it back. Sounds weird but that is how it is. Here is a very simple program to do this:
#include<occi.h>
#include <iostream>
using namespace oracle::occi;
using namespace std;
int main()
try
Environment *env = Environment::createEnvironment(Environment::OBJECT);
Connection *conn = env->createConnection("hr","hr","");
string stmt1 = "insert into blob_tab values (:1) ";
string stmt2 = "select col1 from blob_tab";
Blob blob(conn);
blob.setEmpty(conn);
Statement *stmtObj = conn->createStatement(stmt1);
stmtObj->setBlob(1,blob);
stmtObj->executeUpdate();
conn->commit();
Blob blob1(conn);
Statement *stmtObj2 = conn->createStatement(stmt2);
ResultSet *rs = stmtObj2->executeQuery();
while(rs->next())
blob1 = rs->getBlob(1);
string stmt3 = "begin my_proc(:1) ;end;";
Statement *stmtObj3 = conn->createStatement(stmt3);
stmtObj3->setBlob(1,blob1);
stmtObj3->executeUpdate();
catch (SQLException e)
cout << e.getMessage();
/* The tables and procedure are primitive but ok for demo
create table blob_tab(col1 blob);
create or replace procedure my_proc(arg in blob)
as
begin
-- just a putline here. you can do other more meaningful operations with the blob here
dbms_output.put_line('hello');
end;
}Hope this helps.
Thanks,
Sumit -
Calling a Stored Procedure with output parameters from Query Templates
This is same problem which Shalaka Khandekar logged earlier. This new thread gives the complete description about our problem. Please go through this problem and suggest us a feasible solution.
We encountered a problem while calling a stored procedure from MII Query Template as follows-
1. Stored Procedure is defined in a package. Procedure takes the below inputs and outputs.
a) Input1 - CLOB
b) Input2 - CLOB
c) Input3 - CLOB
d) Output1 - CLOB
e) Output2 - CLOB
f) Output3 - Varchar2
2. There are two ways to get the output back.
a) Using a Stored Procedure by declaring necessary OUT parameters.
b) Using a Function which returns a single value.
3. Consider we are using method 2-a. To call a Stored Procedure with OUT parameters from the Query Template we need to declare variables of
corresponding types and pass them to the Stored Procedure along with the necessary input parameters.
4. This method is not a solution to get output because we cannot declare variables of some type(CLOB, Varchar2) in Query Template.
5. Even though we are successful (step 4) in declaring the OUT variables in Query Template and passed it successfully to the procedure, but our procedure contains outputs which are of type CLOB. It means we are going to get data which is more than VARCHAR2 length which query template cannot return(Limit is 32767
characters)
6. So the method 2-a is ruled out.
7. Now consider method 2-b. Function returns only one value, but we have 3 different OUT values. Assume that we have appended them using a separator. This value is going to be more than 32767 characters which is again a problem with the query template(refer to point 5). So option 2-b is also ruled out.
Apart from above mentioned methods there is a work around. It is to create a temporary table in the database with above 3 OUT parameters along with a session specific column. We insert the output which we got from the procedure to the temporary table and use it further. As soon the usage of the data is completed we delete the current session specific data. So indirectly we call the table as a Session Table. This solution increases unnecessary load on the database.
Thanks in Advance.
RajeshRajesh,
please check if this following proposal could serve you.
Define the Query with mode FixedQueryWithOutput. In the package define a ref cursor as IN OUT parameter. To get your 3 values back, open the cursor in your procedure like "Select val1, val2, val3 from dual". Then the values should get into your query.
Here is an example how this could be defined.
Package:
type return_cur IS ref CURSOR;
Procedure:
PROCEDURE myProc(myReturnCur IN OUT return_cur) ...
OPEN myReturnCur FOR SELECT val1, val2, val3 FROM dual;
Query:
DECLARE
MYRETURNCUR myPackage.return_cur;
BEGIN
myPackage.myProc(
MYRETURNCUR => ?
END;
Good luck.
Michael -
Calling a stored procedure runs into an error
Hello,
We are testing the Database Adapter.
In our database we created the following
- Table tt
- Package ttpackage, with a procedure with 1 input and 1 output parameter which inserts a record in the tt table.
(see scripts at bottom of message)
We created a Database Adapter based upon this Package (Call a stored procedure or function) and register this Database Adapter with the Integration Server.
When we invoke this Database Adapter and enter the input, we can see in the database that 4 records are created. The Web Service returns after a minute with an error
How can we solve this problem?
Regards Leon Smiers
ERROR
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>env:Server</faultcode><faultstring>oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
at java.util.Vector.get(Vector.java:710)
at oracle.tip.esb.server.common.wsif.WSIFInvoker.readResponseHeader(Unknown Source)
SCRIPT
drop table tt
drop sequence seq_tt;
drop package ttpackage;
create table tt
(field1 number(10) not null
,field2 varchar2(25) not null
,status varchar2(1) not null
,primary key (field1)
create sequence seq_tt;
create or replace package ttpackage is
procedure insert_tt(
pi_field2 in tt.field2%type,
po_status out klacht_data.status%type);
end;
show errors
create or replace package body ttpackage is
procedure insert_tt(
pi_field2 in tt.field2%type,
po_status out klacht_data.status%type) is
begin
po_status:='I';
insert into tt
(field1, field2,status)
values(seq_tt.nextval,pi_field2,po_status);
end insert_tt;
end;
show errors
/Hello Dave,
Thanks for the quick fix.
I've tested the fix. The 'Array index out of range: 0' disappeared.
I get, unfortunately, the following error. I already described the steps I take in the first message. Based upon the TTpackage I create a Database adapter, register it with the ESB and invoke the URL from the ESB.
Regards Leon
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>env:Server</faultcode><faultstring>oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "oracle.xml.parser.v2.XMLDOMException: Ongeldige naamruimte http://xmlns.oracle.com/pcbpel/adapter/db/OCOP/TTPACKAGE/INSERT_TT/ voor prefix xmlns
at oracle.xml.parser.v2.XMLElement.setAttributeNS(XMLElement.java:1015)
at oracle.tip.esb.utils.DOMUtil.copyContentsTo(Unknown Source)
at oracle.tip.esb.server.service.impl.soap.EventOracleSoapProvider.raiseEvent(Unknown Source)
at oracle.tip.esb.server.service.impl.soap.EventOracleSoapProvider.processMessage(Unknown Source)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:869)
at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:349)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:460)
at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:114)
at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:96)
at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:177)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
</faultstring><faultactor></faultactor></env:Fault></env:Body></env:Envelope> -
ORABPEL-11809 - call a stored procedure - error in OUT parameter
Hi all.
I have a problem in a BPEL process that calls a stored procedure.
I create a Partner Link that calls a stored procedure in the database. That procedure returns a type that is a table (is defined as a type of the database).
When I deploy the process I have the following error:
<messages>
- <input>
- <WC01_Pesquisa_Ut_InputVariable>
- <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="InputParameters">
- <InputParameters xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/IGIF/WC01/PESQUISA_UT/">
<P_NIR xmlns="">
165968274
</P_NIR>
<P_NOME_COMPLETO xmlns="">
carla diogo
</P_NOME_COMPLETO>
<P_SEXO xmlns="">
Feminino
</P_SEXO>
<P_DATA_NASC xmlns="">
2007-03-01
</P_DATA_NASC>
<P_NATURALIDADE xmlns=""/>
</InputParameters>
</part>
</WC01_Pesquisa_Ut_InputVariable>
</input>
- <fault>
- <remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
- <part name="code">
<code>
17002
</code>
</part>
- <part name="summary">
<summary>
file:/oracle/product/10.1.3/SOA/Integration10131/bpel/domains/default/tmp/.bpel_SaudeIdentificarCidadao_5.0_e3768f57d137443e1ba52d4a6d809426.tmp/WC01_Pesquisa_Ut.wsdl [ WC01_Pesquisa_Ut_ptt::WC01_Pesquisa_Ut(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'WC01_Pesquisa_Ut' failed due to: Error registering an out parameter.
An error occurred when registering parameter PESQUISA_UT as an out parameter of the IGIF.WC01.PESQUISA_UT API. Cause: java.sql.SQLException: Io exception: Connection reset [Caused by: Io exception: Connection reset]
; nested exception is:
ORABPEL-11809
Error registering an out parameter.
An error occurred when registering parameter PESQUISA_UT as an out parameter of the IGIF.WC01.PESQUISA_UT API. Cause: java.sql.SQLException: Io exception: Connection reset [Caused by: Io exception: Connection reset]
Check to ensure that the parameter is a valid IN/OUT or OUT parameter of the API. Contact oracle support if error is not fixable.
</summary>
</part>
- <part name="detail">
<detail>
Internal Exception: java.sql.SQLException: Io exception: Connection resetError Code: 17002
</detail>
</part>
</remoteFault>
</fault>
</messages>
The code of the XSD created when I create the partner link is:
<schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/IGIF/WC01/PESQUISA_UT/" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/IGIF/WC01/PESQUISA_UT/"
elementFormDefault="unqualified" attributeFormDefault="unqualified">
<element name="InputParameters">
<complexType>
<sequence>
<element name="P_NIR" type="decimal" db:index="1" db:type="NUMBER" minOccurs="0" nillable="true"/>
<element name="P_NOME_COMPLETO" type="string" db:index="2" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
<element name="P_SEXO" type="string" db:index="3" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
<element name="P_DATA_NASC" type="dateTime" db:index="4" db:type="DATE" minOccurs="0" nillable="true"/>
<element name="P_NATURALIDADE" type="string" db:index="5" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
</sequence>
</complexType>
</element>
<element name="OutputParameters">
<complexType>
<sequence>
<element name="PESQUISA_UT" type="db:TABELA_DE_IDS" db:index="0" db:type="Array" minOccurs="0" nillable="true"/>
</sequence>
</complexType>
</element>
<complexType name="TABELA_DE_IDS">
<sequence>
<element name="PESQUISA_UT_ITEM" type="decimal" db:type="NUMBER" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
</sequence>
</complexType>
</schema>
Any ideia?
Thanks in advance.
CarlaI'd suggest that you turn on xml validation on the bpel boundaries to make sure that the xml being passed to the adapter is valid. You do this by logging in to bpel console, go to Manage Domain, at the bottom of the Configuration tab, set validateXml to true.
Then see if it is an xml validation issue - in which case you will have to fix your maps to make sure it is valid indeed.
Assuming your XML is valid and you are still seeing this error, couple of follow up questions:
- are you using synonyms ?
-- note that synonyms are not supported completely by the adapter at this time.
- could you spell out where your types/sp-pkg resides and what are you connecting as at runtime ?
-- just to keep things simple enough to debug, i'd do everything as just one user and slowly go to a scheme that you desire.
HTH -
Calling a stored procedure with default parameters
Dear all,
I am trying to call a stored procedure that has not all the parameters compulsory, and indeed, there are some I am not interested in. Therefore, I would like to call the stored procedure initializing only some of the parameters but if I miss some of them, I have an SQLException thrown. Is there any way to do that?
Thanks
MarieHi
One way to do it is ---
By using Default Parameters you can miss few parameters while calling a procedure.
=================================================================
As the example below shows, you can initialize IN parameters to default values. That way, you can pass different numbers of actual parameters to a subprogram, accepting or overriding the default values as you please.
Moreover, you can add new formal parameters without having to change every call to the subprogram.
PROCEDURE create_dept (
new_dname VARCHAR2 DEFAULT 'TEMP',
new_loc VARCHAR2 DEFAULT 'TEMP') IS
BEGIN
INSERT INTO dept
VALUES (deptno_seq.NEXTVAL, new_dname, new_loc);
END;
If an actual parameter is not passed, the default value of its corresponding formal parameter is used.
Consider the following calls to create_dept:
create_dept;
create_dept('MARKETING');
create_dept('MARKETING', 'NEW YORK');
The first call passes no actual parameters, so both default values are used.
The second call passes one actual parameter, so the default value for new_loc is used.
The third call passes two actual parameters, so neither default value is used.
Usually, you can use positional notation to override the default values of formal parameters.
However, you cannot skip a formal parameter by leaving out its actual parameter.
For example, the following call incorrectly associates the actual parameter 'NEW YORK' with the formal parameter new_dname:
create_dept('NEW YORK'); -- incorrect
You cannot solve the problem by leaving a placeholder for the actual parameter.
For example, the following call is illegal:
create_dept(, 'NEW YORK'); -- illegal
In such cases, you must use named notation, as follows:
create_dept(new_loc => 'NEW YORK');
===============================================================
For more details refer URL http://technet.oracle.com/doc/server.804/a58236/07_subs.htm#3651
Hope this helps
Regards
Ashwini
Maybe you are looking for
-
Error while reading ID of own business system from the SLD
HI guys when trying to send Idoc from my R/3 system to SUS i am getting the following error in XI <SAP:Category>XIServer</SAP:Category> <SAP:Code area="INTERNAL">SLD_NO_OWN_BS</SAP:Code> <SAP:P1>DSM</SAP:P1> <SAP:P2>900</SAP:P2> <SAP:Stack>Er
-
How do I keep iPhone Contacts from being visible in iMessage on MacBook?
I've disabled iMessage, but if you open it and try to type a message, you can easily see all the Contacts from my iPhone. How do I prevent that?
-
Trying to update 7.04 and later. I have verified I am connected to WiFi but the update fails ssying I am not connected. How to fix?
-
ConnectionException: Name space accessor for the java: name space has not b
Hi, While running JUnti test cases I am getting the following. Can anyone help? com.deere.u90.iaf.jdbc.connection.ConnectionException: Name space accessor for the java: name space has not been set. Possible cause is that the user is specifying a java
-
Global data declaration in a function group..
hi, i have created a function group and created 2 FM in that. Both use some common data declarations so i declared those variables in the top include of the function group named LZFGXXXTOP. is this include automatically recognized in my FM or do i ha