Author |
Message
|
prasad.gh789 |
Posted: Fri Nov 20, 2015 4:52 am Post subject: Calling Oracle SP with reference cursor as output parameter |
|
|
Novice
Joined: 06 Aug 2014 Posts: 20
|
Hi All,
This is not a repeat question and I have searched all forums and blogs for the solution & when I didn't find the answer, I am posting this.
Requirement - Call an Oracle SP which as a reference cursor as output parameter from IIB v10.0.0.2. The IIB is installed on linux_x86 64-bit and we are using ODBC Data Direct Driver from IIB.
********* ODBC.INI **************
[ODBC Data Sources]
ORACLEDB=DataDirect ODBC Oracle Wire Protocol
;# Oracle stanza
[ORACLEDB]
Driver=/home/soa_admin/iib-10.0.0.2/server/ODBC/drivers/lib/UKora95.so
Description=DataDirect ODBC Oracle Wire Protocol
HostName=172.23.51.5
PortNumber=1875
ServiceName=STAGCDC
CatalogOptions=0
EnableStaticCursorsForLongData=0
ApplicationUsingThreads=1
EnableDescribeParam=1
OptimizePrepare=1
WorkArounds=536870912
ProcedureRetResults=1
ColumnSizeAsCharacter=1
LoginTimeout=0
;# Following lines added to test stored proc call to oracle
WireProtocolMode=2
EnableScrollableCursors=1
UseCurrentSchema=1
[ODBC]
InstallDir=/home/soa_admin/iib-10.0.0.2/server/ODBC/drivers
UseCursorLib=0
IANAAppCodePage=4
UNICODE=UTF-8
********* ODBC.INI **************
****** The backend SP interface is like this ******
CREATE OR REPLACE PROCEDURE PR_GETAGNTINFO_AGNT_CNTC_DTLS ( VC_AGENTCD VARCHAR2, O_REFGETAGNTINFO_AGNT_CNTC_DTL OUT SYS_REFCURSOR )
******* ESQL that we have written *************
CREATE PROCEDURE CallSP_agentContactDetailsType (IN VC_AGENTCD CHAR)
LANGUAGE DATABASE
DYNAMIC RESULT SETS 1
EXTERNAL NAME "pr_GetAgntInfo_Agnt_cntc_dtls";
CALL CallSP_agentContactDetailsType ('100403', Environment.Variables.ResultSet.RS[]);
******** Error we are getting ************
[IBM][ODBC Oracle Wire Protocol driver][Oracle]ORA-06550: line 1, column 8: PLS-00306: wrong number or types of arguments in call to 'PR_GETAGNTINFO_AGNT_CNTC_DTLS' ORA-06550: line 1, column 8: PL/SQL: Statement ignored.
We have tried many options but nothing seems to be working.
Please advise. |
|
Back to top |
|
 |
maurito |
Posted: Fri Nov 20, 2015 5:36 am Post subject: Re: Calling Oracle SP with reference cursor as output parame |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
prasad.gh789 wrote: |
Hi All,
This is not a repeat question and I have searched all forums and blogs for the solution & when I didn't find the answer, I am posting this.
Requirement - Call an Oracle SP which as a reference cursor as output parameter from IIB v10.0.0.2. The IIB is installed on linux_x86 64-bit and we are using ODBC Data Direct Driver from IIB.
********* ODBC.INI **************
[ODBC Data Sources]
ORACLEDB=DataDirect ODBC Oracle Wire Protocol
;# Oracle stanza
[ORACLEDB]
it is documented in the Knowledge Centre. If I remember well, there are also examples of how to do that.
Driver=/home/soa_admin/iib-10.0.0.2/server/ODBC/drivers/lib/UKora95.so
Description=DataDirect ODBC Oracle Wire Protocol
HostName=172.23.51.5
PortNumber=1875
ServiceName=STAGCDC
CatalogOptions=0
EnableStaticCursorsForLongData=0
ApplicationUsingThreads=1
EnableDescribeParam=1
OptimizePrepare=1
WorkArounds=536870912
ProcedureRetResults=1
ColumnSizeAsCharacter=1
LoginTimeout=0
;# Following lines added to test stored proc call to oracle
WireProtocolMode=2
EnableScrollableCursors=1
UseCurrentSchema=1
[ODBC]
InstallDir=/home/soa_admin/iib-10.0.0.2/server/ODBC/drivers
UseCursorLib=0
IANAAppCodePage=4
UNICODE=UTF-8
********* ODBC.INI **************
****** The backend SP interface is like this ******
CREATE OR REPLACE PROCEDURE PR_GETAGNTINFO_AGNT_CNTC_DTLS ( VC_AGENTCD VARCHAR2, O_REFGETAGNTINFO_AGNT_CNTC_DTL OUT SYS_REFCURSOR )
******* ESQL that we have written *************
CREATE PROCEDURE CallSP_agentContactDetailsType (IN VC_AGENTCD CHAR)
LANGUAGE DATABASE
DYNAMIC RESULT SETS 1
EXTERNAL NAME "pr_GetAgntInfo_Agnt_cntc_dtls";
CALL CallSP_agentContactDetailsType ('100403', Environment.Variables.ResultSet.RS[]);
******** Error we are getting ************
[IBM][ODBC Oracle Wire Protocol driver][Oracle]ORA-06550: line 1, column 8: PLS-00306: wrong number or types of arguments in call to 'PR_GETAGNTINFO_AGNT_CNTC_DTLS' ORA-06550: line 1, column 8: PL/SQL: Statement ignored.
We have tried many options but nothing seems to be working.
Please advise. |
this is documented in the Knowledge centre, and if I remember well, there are examples.
once you have read that, tell us what you have tried.
Also, you will need to show us the Oracle SP signature and the ESQL CREATE Proc signature |
|
Back to top |
|
 |
prasad.gh789 |
Posted: Sat Nov 21, 2015 2:33 am Post subject: |
|
|
Novice
Joined: 06 Aug 2014 Posts: 20
|
Oracle SP
------------
CREATE OR REPLACE PROCEDURE PR_GETAGNTINFO_AGNT_CNTC_DTLS
( VC_AGENTCD VARCHAR2,
O_REFGETAGNTINFO_AGNT_CNTC_DTL OUT SYS_REFCURSOR )
******* ESQL that we have written *************
CREATE PROCEDURE CallSP_agentContactDetailsType (IN VC_AGENTCD CHAR)
LANGUAGE DATABASE
DYNAMIC RESULT SETS 1
EXTERNAL NAME "pr_GetAgntInfo_Agnt_cntc_dtls"; |
|
Back to top |
|
 |
maurito |
Posted: Sat Nov 21, 2015 3:03 am Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
prasad.gh789 wrote: |
CREATE OR REPLACE PROCEDURE PR_GETAGNTINFO_AGNT_CNTC_DTLS
( VC_AGENTCD VARCHAR2 ,
O_REFGETAGNTINFO_AGNT_CNTC_DTL OUT SYS_REFCURSOR )
|
it probably helps if you add the direction to the oracle SP parameters:
( VC_AGENTCD VARCHAR2 IN ,
O_REFGETAGNTINFO_AGNT_CNTC_DTL OUT SYS_REFCURSOR IN OUT ) |
|
Back to top |
|
 |
smdavies99 |
Posted: Sat Nov 21, 2015 5:14 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
I'd alsp make the case if the SP name in the CREATE statement identical to the case used in the SP CREATE statement.
Just to avoid any possible confusion when the flow goes in to maintenance _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
maurito |
Posted: Sat Nov 21, 2015 6:36 am Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
maurito wrote: |
prasad.gh789 wrote: |
CREATE OR REPLACE PROCEDURE PR_GETAGNTINFO_AGNT_CNTC_DTLS
( VC_AGENTCD VARCHAR2 ,
O_REFGETAGNTINFO_AGNT_CNTC_DTL OUT SYS_REFCURSOR )
|
it probably helps if you add the direction to the oracle SP parameters:
( VC_AGENTCD VARCHAR2 IN ,
O_REFGETAGNTINFO_AGNT_CNTC_DTL IN OUT SYS_REFCURSOR) |
|
|
Back to top |
|
 |
eammnsh |
Posted: Sun Jan 15, 2017 8:25 am Post subject: |
|
|
Apprentice
Joined: 22 Aug 2016 Posts: 29
|
Just shorten the name of your cursor/variables. max (30 char) _________________ WMB 7 and 8 IIB 9 and 10
MQ 7, 7.5, and 8
Since 2012 |
|
Back to top |
|
 |
|