Callable statement with oracle stored procedure error
i'm calling a stored procedure in java with the following code. However i constantly recieve this error
so what is going on please HELP
Parameter Type Conflict: sqlType=2006
my call statement would be this:
call Statement = {call getUserByLogin(?,?,?,?)}
if(storedProcedureName=="getUserByLogin"){
strCStmt = ("{call " + storedProcedureName +"(?,?,?,?) }");
cStmt.setObject(1, "system");
cStmt.setObject(2, "username");
cStmt.setObject(3,"password");
cStmt.registerOutParameter(4, java.sql.Types.REF);
rs = cStmt.executeQuery();
i've also tried it with a setString as the IN parameter:
here's the stored procedure:
CREATE OR REPLACE PROCEDURE getUserByLogin (
arg_subscriptionName IN varchar,
arg_loginName IN varchar,
arg_password IN varchar,
arg_rec_userinfo_valLanguage OUT types.rec_userinfo_valLanguage
) AS
var_userNum int;
BEGIN
select
u.userNum into var_userNum
from
userInfo u,
subscription s
where
s.subscriptionName = arg_subscriptionName AND
s.subscriptionNum = u.subscriptionNum AND
u.loginName = arg_loginName AND
u.password = arg_password;
if (var_userNum is null) then
var_userNum := 0;
end if;
getUser(var_userNum, arg_rec_userinfo_valLanguage);
END;
i'm calling a stored procedure in java with the
following code. However i constantly recieve this
error
so what is going on please HELP
Parameter Type Conflict: sqlType=2006
my call statement would be this:
call Statement = {call getUserByLogin(?,?,?,?)}
if(storedProcedureName=="getUserByLogin"){
strCStmt = ("{call " + storedProcedureName +"(?,?,?,?)
cStmt.setObject(1, "system");
cStmt.setObject(2, "username");
cStmt.setObject(3,"password");
cStmt.registerOutParameter(4, java.sql.Types.REF);
rs = cStmt.executeQuery();
i've also tried it with a setString as the IN
parameter:
here's the stored procedure:
CREATE OR REPLACE PROCEDURE getUserByLogin (
arg_subscriptionName IN varchar,
arg_loginName IN varchar,
arg_password IN varchar,
arg_rec_userinfo_valLanguage OUT
types.rec_userinfo_valLanguage
) AS
var_userNum int;
BEGIN
select
u.userNum into var_userNum
from
userInfo u,
subscription s
where
s.subscriptionName = arg_subscriptionName AND
s.subscriptionNum = u.subscriptionNum AND
u.loginName = arg_loginName AND
u.password = arg_password;
if (var_userNum is null) then
var_userNum := 0;
end if;
getUser(var_userNum, arg_rec_userinfo_valLanguage);
END;
/Hai,
Try with this if u are using Oracle.
import oracle.sql.*;
import oracle.jdbc.driver.*;
(inbetween ur code)
cStmt.registerOutParameter(4, OracleTypes.CURSOR);
//in place of "cStmt.registerOutParameter(4, java.sql.Types.REF);"
Hope u reply with joy.
regards,
Siva Kumar Annavaram
Similar Messages
-
JDBC Sender adapter - Oracle - Stored Procedure - Error
Hello,
Need few clarifications on JDBC sender adapter and stored procedures when connecting to Oracle DB.
My scenario is, Oracle to SAPBW. So in sender JDBC adapter, we have used a SP having multiple SQL statements it, esp. one of the SELECT statment having Joins on a table and View.
My questions are,
1) Is it possible to have more SQL statements in SP for Sender JDBC?
2) Is the SP of Oracle DB returns resultset or cursor?
I have tried in searching the forum perticularly for connecting to Oracle as Sender and below like said that there is a limitation of XI JDBC when connecting to Oracle.
Executing an Oracle Stored Procedure from Sender JDBC adapter
So please clarify the doubts and help me.
With regards,
JilanHi Jilan,
Unlike what was mentioned in the link given by you that oracle returns cursor and not resultset is not completely true. It may be difficult but certainly not impossible.
Refer : http://www.enterprisedt.com/publications/oracle/result_set.html
regards
joel -
Extraction SQL statement from oracle stored procedure stored in file
Hi,
I am newbie to oracle stored procedure. I need to extract the list of sqls present in oracle stored procedure. Besides that I also want to parse these sql statements to get the list of tables and columns used. Is there any tool which can help me in doing thats.
thanks,
govindwhy don't check on user_dependencies table instead?
select referenced_name,referenced_type
from user_dependencies
where name='<your stored procedure name in upper case>'
and referenced_type = 'TABLE'HTH,
Prazy -
Crystal reports for eclipse ver 2 with oracle stored procedures
Does Crystal Reports for Eclipse version 2 support Oracle Stored Procedures.
I have been struggling to get this to work for the last 1 week.
Any help would be appreciated.
Regards
Avinash TauroThank you for your reply.
Does this mean that oracle stored procedures cannot be used at all in the J2EE environment. As even if I create the report using Crystal Reports 2008, I am unable to get it to work.
However It works great on .NET.
Since I can't use stored procedures, I've just copied the query to a bean and am executing it using jdbc. Also I am using the POJO method to link to the report.
This is working fine, except for the maintainance headache, as I have about 25 stored procedures for reporting, with each having a pretty complex query.
I guess I will convert all the stored procedures to front end based query mangement and use the POJO method to connect Crystal Reports.
Any suggestions / recommendations would be helpful.
Regards
Avinash Tauro -
Help Required on Cross Referencing with Oracle Stored Procedure
Hi Experts,
I have a requirement which is having the requirements as follow,
Web Application initially sends a request number to SAP ECC to fetch the response details through SAP PI (HTTP to RFC u2013 Synchronous). While fetching the response from SAP ECC system, SAP PI has to invoke a Oracle Stored Procedure based on some parameter from SAP ECC System and then composited data has to send back to Web Application by SAP PI.
Request you to kindly suggest how to achieve the above. JDBC lookup is not much extended to call stored procedure. It would be helpful if it will be a step by step as I am novice to SAP PI.
Regards
Archanayou might very well have to use a BPM.
open a sync/async bridge ->
do a sync call to RFC ->
Do a sync call to DB (use SP here) ->
do a transformation from the response message of RFC and Response of DB (N:1) to for your response to original caller (http)
Close the sync async bridge using the response message -
SSRS with Oracle Stored Procedures, Functions and Packages
Hi,
I am working on a BI project. Here we are using PowerPivot to access data from Oracle DB and generate reports. Currently Client generates Few reports using Oracle Stored Procedures, Functions and Packages. We need to move everything to PowerPivot, so
that user can generate all reports using same platform. But PowerPivot doesn'e support Oracle Stored Procedures, Functions and Packages. So we have decided to try those reports using SSRS.
I have no knowledge about using SSRS which will call Oracle function/stored procedures/packages for generating reports.
Can anybody help me in getting exact steps?
Please let me know if my question is not clear enough.
Thanks and Regards,
SSHi Visakh,
Thanks for the detailed steps. My next question is:
Is there any other way to develop such reports without using any development tool like Visual Studio? Our aim is to provide a self-serviced reporting platform where user don't need any technical knowledge.
I am sorry I have no knowledge about SSRS and Oracle DB.Can you please have a look at my Oracle function and let me know whether it's possible to execute this using SSRS? (I am pasting one by one as there is a character limit.
CREATE OR REPLACE TYPE obj_special_pass_cases
AS OBJECT
CLAIM_ID NUMBER(12),
claim_ref_no VARCHAR2(20),
OFFICER_NAME VARCHAR2(201),
SUBMIT_DT VARCHAR2(10),
ACC_DT VARCHAR2(10),
SP_ISSUE_DT VARCHAR2(10),
STATUS VARCHAR2(30),
SUB_STATUS VARCHAR2(30),
STATUS_LAST_UPDATE_DATE VARCHAR2(10),
SP_EXP_DT VARCHAR2(10),
INDUSTRY_CODE VARCHAR2(8),
EMP_SSIC VARCHAR2(8),
rel VARCHAR2(4),
WPNo VARCHAR2(20),
FIN VARCHAR2(9),
PASSPORT_NO VARCHAR2(16),
SPNo VARCHAR2(20),
VictimName VARCHAR2(100),
SP_EXT_PURPOSE VARCHAR2(100),
ISSUE_SYSTEM VARCHAR2(4),
REPATRIATION_DATE VARCHAR2(10),
SP_STATUS VARCHAR2(30),
SP_ISSUE_PURPOSE VARCHAR2(500)
CREATE OR REPLACE TYPE tbl_special_pass_cases
AS TABLE OF obj_special_pass_cases
CREATE OR REPLACE TYPE obj_special_pass_casesNew
AS OBJECT
CLAIM_ID NUMBER(12),
claim_ref_no VARCHAR2(20),
OFFICER_NAME VARCHAR2(201),
SUBMIT_DT VARCHAR2(10), /*Case Registration Date*/
ACC_DT VARCHAR2(10),
SP_ISSUE_DT VARCHAR2(10),
calc_sp_issue_dt VARCHAR2(10),
calc_sp_issue_dt_month VARCHAR2(2),
calc_sp_issue_dt_year VARCHAR2(4),
calc_Duration_Of_Stay VARCHAR2(4),
STATUS VARCHAR2(30),
SUB_STATUS VARCHAR2(30),
STATUS_LAST_UPDATE_DATE VARCHAR2(10),
lastUpdateDtMonth varchar2(2),
lastUpdateDtYear varchar2(4),
DurationOfUpdateDt VARCHAR2(4),
SP_EXP_DT VARCHAR2(10),
INDUSTRY_CODE VARCHAR2(8),
EMP_SSIC VARCHAR2(8),
rel VARCHAR2(4),
WPNo VARCHAR2(20), /* New columns from here - SR */
FIN VARCHAR2(9),
PASSPORT_NO VARCHAR2(16),
SPNo VARCHAR2(20),
VictimName VARCHAR2(100),
workerNationality VARCHAR2(20),
employName VARCHAR2(200),
reportType VARCHAR2(10),
SP_EXT_PURPOSE VARCHAR2(100),
ISSUE_SYSTEM VARCHAR2(4), /*IWPS, EIDS*/
REPATRIATION_DATE VARCHAR2(10),
SP_STATUS VARCHAR2(30),
SP_ISSUE_PURPOSE VARCHAR2(500)
CREATE OR REPLACE TYPE tbl_special_pass_casesNew
AS TABLE OF obj_special_pass_casesNew
FUNCTION getListOfSpecialPassCases(
vRepatriationDateFrom VARCHAR2,
vRepatriationDateTo VARCHAR2,
vIncludeRepatriationDate VARCHAR2)
RETURN tbl_special_pass_cases
IS
TYPE cur_typ IS REF CURSOR;
SPECIAL_PASS_CASES_CUR cur_typ;
vSQL1 VARCHAR2(4000);
--vSQL1 VARCHAR2(4000) := 'SELECT DISTINCT(A.CLAIM_ID), A.CLAIM_REF_NO, A.STATUS, A.SUB_STATUS, A.OFFICER_NAME, A.SUBMIT_DT, A.ACC_DT, A.vLatestUpdatedDate, A.INDUSTRY_CODE, A.ID_NO, A.vWorkerName, B.vSPWPNO, B.vFIN, B.vSPPassportNo,
B.vSPIssueDate, B.vSPExpiryDate, B.vSPNo, DECODE(B.vSPExtensionPurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''13'',''FMMD'',''14'',''TMB
PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION (SB-F)'') vSPExtensionPurpose, B.vIssueSystem, B.vSPActualDepartDate, B.vSPStatus, DECODE(B.vSPIssuePurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE
RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''11'',''PENDING DOCUMENT VERIFICATION'',''12'',''LATE ERENEWAL'',''13'',''FMMD'',''14'',''TMB PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION
(SB-F)'') vSPIssuePurpose FROM (SELECT vSPWPNO, vFIN, vSPPassportNo, vSPIssueDate, vSPExpiryDate, vSPNo, vSPExtensionPurpose, vIssueSystem, vSPActualDepartDate, vSPStatus, vSPIssuePurpose FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSActiveSpecialPass) WHERE
(vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B JOIN (SELECT WC.CLAIM_ID CLAIM_ID, WC.CLAIM_REF_NO CLAIM_REF_NO, WC.STATUS STATUS, WC.SUB_STATUS SUB_STATUS, TAS.LAST_NAME ||'' ''|| TAS.FIRST_NAME OFFICER_NAME, to_char(trunc(IRN.SUBMIT_DT), ''dd/MM/yyyy'')
SUBMIT_DT, TO_CHAR(trunc(decode(wc.assessmt_type,''OD-PI'',EV.OD_CONSULT_DT,''OD-TI'',ev.od_consult_dt,ECASE.acc_dt)), ''dd/MM/yyyy'') ACC_DT, (SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), ''dd/MM/yyyy'') STATUS_LAST_UPDATE_DATE FROM WIC_CLAIM_STATUS WCS WHERE
WCS.CLAIM_ID=WC.CLAIM_ID) vLatestUpdatedDate, EC.INDUSTRY_CODE INDUSTRY_CODE, EP.ID_NO ID_NO, EP.NAME vWorkerName FROM EVENT_PERSON EP, WIC_CLAIMS WC, TBL_AA_SUBJECT TAS, EVENT_COMPANY EC,EVENT_CASE ECASE,event_victim ev WHERE EP.ID_NO IS NOT NULL AND EP.DELETE_IND
= ''F'' AND EP.INVOLVEMENT = ''VICTIM'' AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID AND ep.event_person_id = ev.event_person_id (+) AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID AND EC.EVENT_CASE_NO=WC.EVENT_CASE_NO AND
EC.INVOLVEMENT in (''EMPLOYER'',''EMPLOYER_OCCUPIER'') AND ECASE.EVENT_CASE_NO=WC.EVENT_CASE_NO AND EC.DELETE_IND = ''F'') A ON (B.vFIN = A.ID_NO OR B.vSPPassportNo = A.ID_NO)';
vSQL2 VARCHAR2(4000);
--vSQL2 VARCHAR2(4000) := 'SELECT DISTINCT(A.CLAIM_ID),A.CLAIM_REF_NO,A.STATUS,A.SUB_STATUS,A.OFFICER_NAME,A.SUBMIT_DT,A.ACC_DT,A.vLatestUpdatedDate,A.INDUSTRY_CODE,A.ID_NO,A.vWorkerName,B.vSPWPNO,B.vFIN,B.vSPPassportNo,B.vSPIssueDate,B.vSPExpiryDate,B.vSPNo,DECODE(B.vSPExtensionPurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE
RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''13'',''FMMD'',''14'',''TMB PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION (SB-F)'') vSPExtensionPurpose,B.vIssueSystem,B.vSPActualDepartDate,B.vSPStatus,DECODE(B.vSPIssuePurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE
RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''11'',''PENDING DOCUMENT VERIFICATION'',''12'',''LATE ERENEWAL'',''13'',''FMMD'',''14'',''TMB PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION
(SB-F)'') vSPIssuePurpose FROM (SELECT vSPWPNO,vFIN,vSPPassportNo,vSPIssueDate,vSPExpiryDate,vSPNo,vSPExtensionPurpose,vIssueSystem,vSPActualDepartDate,vSPStatus,vSPIssuePurpose FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSDepartedSpecialPass(''' || vRepatriationDateFrom
|| ''', ''' || vRepatriationDateTo || ''')) WHERE (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B JOIN (SELECT WC.CLAIM_ID CLAIM_ID, WC.CLAIM_REF_NO CLAIM_REF_NO, WC.STATUS STATUS,WC.SUB_STATUS SUB_STATUS, TAS.LAST_NAME ||'' ''|| TAS.FIRST_NAME OFFICER_NAME,
to_char(trunc(IRN.SUBMIT_DT), ''dd/MM/yyyy'') SUBMIT_DT,TO_CHAR(trunc(decode(wc.assessmt_type,''OD-PI'',EV.OD_CONSULT_DT,''OD-TI'',ev.od_consult_dt,ECASE.acc_dt)), ''dd/MM/yyyy'') ACC_DT, (SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), ''dd/MM/yyyy'') STATUS_LAST_UPDATE_DATE
FROM WIC_CLAIM_STATUS WCS WHERE WCS.CLAIM_ID=WC.CLAIM_ID) vLatestUpdatedDate, EC.INDUSTRY_CODE INDUSTRY_CODE, EP.ID_NO ID_NO, EP.NAME vWorkerName FROM EVENT_PERSON EP, WIC_CLAIMS WC, TBL_AA_SUBJECT TAS, EVENT_COMPANY EC,EVENT_CASE ECASE, IR_NOTIFICATION IRN,event_victim
ev WHERE EP.ID_NO IS NOT NULL AND EP.DELETE_IND = ''F'' AND EP.INVOLVEMENT = ''VICTIM'' AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID and ep.event_person_id = ev.event_person_id (+) AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID
AND EC.EVENT_CASE_NO=WC.EVENT_CASE_NO AND EC.INVOLVEMENT in (''EMPLOYER'',''EMPLOYER_OCCUPIER'') AND ECASE.EVENT_CASE_NO=WC.EVENT_CASE_NO AND IRN.REF_NO(+) = ECASE.IR_REF_NO AND IRN.SUBMIT_TYPE IN (''SI'',''SE'') AND EC.DELETE_IND = ''F'') A ON (B.vFIN = A.ID_NO
OR B.vSPPassportNo = A.ID_NO)';
SPECIAL_PASS_CASES_TBL tbl_special_pass_cases := tbl_special_pass_cases();
cursor sp_pass_settle_cur is
SELECT DISTINCT (A.CLAIM_ID),
A.CLAIM_REF_NO,
A.STATUS,
A.SUB_STATUS,
A.OFFICER_NAME,
A.SUBMIT_DT,
A.ACC_DT,
A.vLatestUpdatedDate,
A.INDUSTRY_CODE,
A.ID_NO,
A.vWorkerName,
B.vSPWPNO,
B.vFIN,
B.vSPPassportNo,
B.vSPIssueDate,
B.vSPExpiryDate,
B.vSPNo,
DECODE(B.vSPExtensionPurpose,
'1',
'WICB',
'2',
'RE - APPLICATION',
'3',
'POLICE',
'4',
'REPATRIATION',
'5',
'LRD',
'6',
'LATE RENEWAL',
'9',
'OTHERS',
'10',
'LATE EISSUANCE',
'13',
'FMMD',
'14',
'TMB PENDING REPATRIATION',
'15',
'TMB REPATRIATION',
'16',
'PENDING REPATRIATION(SB - F)',
'17',
'REPATRIATION(SB - F)') vSPExtensionPurpose,
B.vIssueSystem,
B.vSPActualDepartDate,
B.vSPStatus,
DECODE(B.vSPIssuePurpose,
'1',
'WICB',
'2',
'RE - APPLICATION',
'3',
'POLICE',
'4',
'REPATRIATION',
'5',
'LRD',
'6',
'LATE RENEWAL',
'9',
'OTHERS',
'10',
'LATE EISSUANCE',
'11',
'PENDING DOCUMENT VERIFICATION',
'12',
'LATE ERENEWAL',
'13',
'FMMD',
'14',
'TMB PENDING REPATRIATION',
'15',
'TMB REPATRIATION',
'16',
'PENDING REPATRIATION(SB - F)',
'17',
'REPATRIATION(SB - F)') vSPIssuePurpose
FROM (SELECT vSPWPNO,
vFIN,
vSPPassportNo,
vSPIssueDate,
vSPExpiryDate,
vSPNo,
vSPExtensionPurpose,
vIssueSystem,
vSPActualDepartDate,
vSPStatus,
vSPIssuePurpose
FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSActiveSpecialPass)
WHERE (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B
JOIN (SELECT WC.CLAIM_ID CLAIM_ID,
WC.CLAIM_REF_NO CLAIM_REF_NO,
WC.STATUS STATUS,
WC.SUB_STATUS SUB_STATUS,
TAS.LAST_NAME ||''|| TAS.FIRST_NAME OFFICER_NAME,
'' SUBMIT_DT,
TO_CHAR(trunc(decode(wc.assessmt_type,
'OD-PI',
EV.OD_CONSULT_DT,
'OD-TI',
ev.od_consult_dt,
ECASE.acc_dt)),
'dd/MM/yyyy') ACC_DT,
(SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), 'dd/MM/yyyy') STATUS_LAST_UPDATE_DATE
FROM WIC_CLAIM_STATUS WCS
WHERE WCS.CLAIM_ID = WC.CLAIM_ID) vLatestUpdatedDate,
EC.INDUSTRY_CODE INDUSTRY_CODE,
EP.ID_NO ID_NO,
EP.NAME vWorkerName
FROM EVENT_PERSON EP,
WIC_CLAIMS WC,
TBL_AA_SUBJECT TAS,
EVENT_COMPANY EC,
EVENT_CASE ECASE,
event_victim ev
WHERE EP.ID_NO IS NOT NULL
AND EP.DELETE_IND = 'F'
AND EP.INVOLVEMENT = 'VICTIM'
AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO
AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID
AND ep.event_person_id = ev.event_person_id(+)
AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID
AND EC.EVENT_CASE_NO = WC.EVENT_CASE_NO
AND EC.INVOLVEMENT in ('EMPLOYER', 'EMPLOYER_OCCUPIER')
AND ECASE.EVENT_CASE_NO = WC.EVENT_CASE_NO
AND EC.DELETE_IND = 'F') A ON (B.vFIN = A.ID_NO OR B.vSPPassportNo = A.ID_NO);
sp_pass_settle_rec sp_pass_settle_cur%rowtype;
cursor sp_details_with_dt_cur is
SELECT DISTINCT (A.CLAIM_ID),
A.CLAIM_REF_NO,
A.STATUS,
A.SUB_STATUS,
A.OFFICER_NAME,
A.SUBMIT_DT,
A.ACC_DT,
A.vLatestUpdatedDate,
A.INDUSTRY_CODE,
A.ID_NO,
A.vWorkerName,
B.vSPWPNO,
B.vFIN,
B.vSPPassportNo,
B.vSPIssueDate,
B.vSPExpiryDate,
B.vSPNo,
DECODE(B.vSPExtensionPurpose,'1','WICB', '2','RE - APPLICATION','3','POLICE','4','REPATRIATION','5','LRD','6','LATE RENEWAL','9','OTHERS','10','LATE EISSUANCE',
'13','FMMD','14','TMB PENDING REPATRIATION','15','TMB REPATRIATION','16','PENDING REPATRIATION(SB - F)','17','REPATRIATION(SB
- F)') vSPExtensionPurpose,
B.vIssueSystem,
B.vSPActualDepartDate,
B.vSPStatus,
DECODE(B.vSPIssuePurpose,
'1','WICB','2','RE - APPLICATION','3','POLICE','4','REPATRIATION','5','LRD','6','LATE RENEWAL','9','OTHERS', '10', 'LATE EISSUANCE','11','PENDING
DOCUMENT VERIFICATION',
'12','LATE ERENEWAL','13','FMMD','14','TMB PENDING REPATRIATION','15','TMB REPATRIATION','16','PENDING REPATRIATION(SB - F)','17','REPATRIATION(SB
- F)') vSPIssuePurpose
FROM (SELECT vSPWPNO,
vFIN,
vSPPassportNo,
vSPIssueDate,
vSPExpiryDate,
vSPNo,
vSPExtensionPurpose,
vIssueSystem,
vSPActualDepartDate,
vSPStatus,
vSPIssuePurpose
FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSDepartedSpecialPass(''|| vRepatriationDateFrom ||'', ''|| vRepatriationDateTo ||''))
WHERE (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B
JOIN (SELECT WC.CLAIM_ID CLAIM_ID,
WC.CLAIM_REF_NO CLAIM_REF_NO,
WC.STATUS STATUS,
WC.SUB_STATUS SUB_STATUS,
TAS.LAST_NAME ||''|| TAS.FIRST_NAME OFFICER_NAME,
to_char(trunc(IRN.SUBMIT_DT), 'dd/MM/yyyy') SUBMIT_DT,
TO_CHAR(trunc(decode(wc.assessmt_type,
'OD - PI',
EV.OD_CONSULT_DT,
'OD - TI',
ev.od_consult_dt,
ECASE.acc_dt)),
'dd/MM/yyyy') ACC_DT,
(SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), 'dd/MM/yyyy') STATUS_LAST_UPDATE_DATE
FROM WIC_CLAIM_STATUS WCS
WHERE WCS.CLAIM_ID = WC.CLAIM_ID) vLatestUpdatedDate,
EC.INDUSTRY_CODE INDUSTRY_CODE,
EP.ID_NO ID_NO,
EP.NAME vWorkerName
FROM EVENT_PERSON EP,
WIC_CLAIMS WC,
TBL_AA_SUBJECT TAS,
EVENT_COMPANY EC,
EVENT_CASE ECASE,
IR_NOTIFICATION IRN,
event_victim ev
WHERE EP.ID_NO IS NOT NULL
AND EP.DELETE_IND = 'F'
AND EP.INVOLVEMENT = 'VICTIM'
AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO
AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID
and ep.event_person_id = ev.event_person_id(+)
AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID
AND EC.EVENT_CASE_NO = WC.EVENT_CASE_NO
AND EC.INVOLVEMENT in ('EMPLOYER', 'EMPLOYER_OCCUPIER')
AND ECASE.EVENT_CASE_NO = WC.EVENT_CASE_NO
AND IRN.REF_NO(+) = ECASE.IR_REF_NO
AND IRN.SUBMIT_TYPE IN ('SI', 'SE')
AND EC.DELETE_IND = 'F') A ON (B.vFIN = A.ID_NO OR B.vSPPassportNo = A.ID_NO);
sp_details_with_dt_rec sp_details_with_dt_cur%rowtype;
/*vSQL VARCHAR2(4000);
vFIN VARCHAR2(9);
vSPPassportNo VARCHAR2(16);
vSPWPNO VARCHAR2(20);
vSPIssueDate VARCHAR2(10);
vSPExpiryDate VARCHAR2(10);
vSPNo VARCHAR2(20);
vSPExtensionPurpose VARCHAR2(100);
vIssueSystem VARCHAR2(4);
vSPActualDepartDate VARCHAR2(10);
vSPStatus VARCHAR2(30);
vSPIssuePurpose VARCHAR2(500);
CLAIM_ID NUMBER(12);
CLAIM_REF_NO VARCHAR2(20);
STATUS VARCHAR2(30);
SUB_STATUS VARCHAR2(30);
OFFICER_NAME VARCHAR2(201);
SUBMIT_DT VARCHAR2(10);
ACC_DT VARCHAR2(10);
vLatestUpdatedDate VARCHAR2(10);
INDUSTRY_CODE VARCHAR2(8);
ID_NO VARCHAR2(50);
vWorkerName VARCHAR2(100);*/
BEGIN
if vIncludeRepatriationDate = 'Y' then
for sp_details_with_dt_rec in sp_details_with_dt_cur
loop
SPECIAL_PASS_CASES_TBL.EXTEND;
SPECIAL_PASS_CASES_TBL(SPECIAL_PASS_CASES_TBL.LAST) := obj_special_pass_cases(sp_details_with_dt_rec.CLAIM_ID,sp_details_with_dt_rec.CLAIM_REF_NO,sp_details_with_dt_rec.OFFICER_NAME,sp_details_with_dt_rec.SUBMIT_DT,sp_details_with_dt_rec.ACC_DT,sp_details_with_dt_rec.vSPIssueDate,sp_details_with_dt_rec.STATUS,sp_details_with_dt_rec.SUB_STATUS,sp_details_with_dt_rec.vLatestUpdatedDate,sp_details_with_dt_rec.vSPExpiryDate,sp_details_with_dt_rec.INDUSTRY_CODE,sp_details_with_dt_rec.INDUSTRY_CODE,'a',sp_details_with_dt_rec.vSPWPNO,sp_details_with_dt_rec.vFIN,sp_details_with_dt_rec.vSPPassportNo,sp_details_with_dt_rec.vSPNo,sp_details_with_dt_rec.vWorkerName,sp_details_with_dt_rec.vSPExtensionPurpose,sp_details_with_dt_rec.vIssueSystem,sp_details_with_dt_rec.vSPActualDepartDate,sp_details_with_dt_rec.vSPStatus,sp_details_with_dt_rec.vSPIssuePurpose);
end loop;
else
for sp_pass_settle_rec in sp_pass_settle_cur
loop
SPECIAL_PASS_CASES_TBL.EXTEND;
SPECIAL_PASS_CASES_TBL(SPECIAL_PASS_CASES_TBL.LAST) := obj_special_pass_cases(sp_pass_settle_rec.CLAIM_ID,sp_pass_settle_rec.CLAIM_REF_NO,sp_pass_settle_rec.OFFICER_NAME,sp_pass_settle_rec.SUBMIT_DT,sp_pass_settle_rec.ACC_DT,sp_pass_settle_rec.vSPIssueDate,sp_pass_settle_rec.STATUS,sp_pass_settle_rec.SUB_STATUS,sp_pass_settle_rec.vLatestUpdatedDate,sp_pass_settle_rec.vSPExpiryDate,sp_pass_settle_rec.INDUSTRY_CODE,sp_pass_settle_rec.INDUSTRY_CODE,'a',sp_pass_settle_rec.vSPWPNO,sp_pass_settle_rec.vFIN,sp_pass_settle_rec.vSPPassportNo,sp_pass_settle_rec.vSPNo,sp_pass_settle_rec.vWorkerName,sp_pass_settle_rec.vSPExtensionPurpose,sp_pass_settle_rec.vIssueSystem,sp_pass_settle_rec.vSPActualDepartDate,sp_pass_settle_rec.vSPStatus,sp_pass_settle_rec.vSPIssuePurpose);
end loop;
end if ;
RETURN SPECIAL_PASS_CASES_TBL;
END getListOfSpecialPassCases;
Thanks,
SS -
Got error when use case statement in oracle stored procedure
Hi,
I have a query like:
select merchant_id,
case
when product_type='K' then 'Production'
when product_carrier='UC' THEN 'Shipping'
end the_type
from product_tbl
where merchant_id=10114
It works fine. But as soon as I put it into a stored procedure, I got error like:
Encountered the symbol "CASE" when expecting one of the following:
( - + mod null <an identifier>
Please help!Oracle 8i doesn't support CASE into PL/SQL, so as Kamal said, create a view with the CASE, and use this view into your PL/SQL.
Nicolas.
And an example here :
Re: Execute Immediate doesnot work in 8i (8.1.7) and Ref Cursor not exec qu
Sorry Kamal.
Message was edited by:
N. Gasparotto -
Dear Oracle Experts,
I try to use the stored procedure below but get this error :
"Error(4,1): PLS-00428: an INTO clause is expected in this SELECT statement"
I don't have any clue what could be wrong with my syntax. INTO wouldn't make any sense at this task.
Does someone of you know what's wrong with my Procedure ?
Hope someone can help,
best regards,
Daniel Wetzler
create or replace PROCEDURE AnalysisCompatibility (DATEBEGIN timestamp, DATEEND timestamp)
AS
BEGIN
select Fs.*,Vs.Analysispriority,Vs.Compatibility Compatibility from SigFacts Fs
inner Join Variables Vs On
(Fs.Var_Ref=Vs.Var_Ref and Fs.Machines_Ref=Vs.Machines_Ref )
where Fs.DT between DATEBEGIN and DATEEND
and
Vs.AnalysisPriority > 0
or
VS.Compatibility in (6,7,8,9,10,11,13,21,22)
order by Fs.DT,Fs.Machines_Ref desc, Vs.AnalysisPriority;
END AnalysisCompatibility;I have created a table (ATREPORT.TEST) that has has got the same column name and type of the query output and i still get error message
PLS-00403 -- statement ATreport.TESt cannot be used as an into target, pls help
DECLARE start_date DATE := to_date('01/09/2006' , 'DD-MON-YYYY');
end_date DATE := to_date('30/09/2006' , 'DD-MON-YYYY');
BEGIN
SELECT t.SEC_SHORT_NAME, t.SEC_ISIN, t.SEC_NO,t.SEC_NAME, t.TRADE_DATE,
t.PAYMENT_DATE,t.COUNTERPARTY, t.PRICE , t.NOMINAL ,
t.TRANSACTION_NO,t.CURRENT_VALUE_PC, t.CURRENT_VALUE_SC, t.PAYMENT_AMOUNT_PC,
t.PAYMENT_AMOUNT_SC,
ct.AMOUNT , ct.CURRENCY,
sb.BUSINESS_CLASS_LEVEL_2 ,sb.BUSINESS_CLASS_LEVEL_2_NAME,
sb.BUSINESS_CLASS_LEVEL_3 ,sb.BUSINESS_CLASS_LEVEL_3_NAME,
sb.BUSINESS_CLASS_LEVEL_4 ,sb.BUSINESS_CLASS_LEVEL_4_NAME,
sb.BUSINESS_CLASS_LEVEL_5 ,sb.BUSINESS_CLASS_LEVEL_5_NAME
INTO ATREPORT.TEST
from scdat.A_TRANSACTIONS t
INNER JOIN scdat.A_COSTTAX ct
ON ct.TRANS_REF = t.TRANS_REF
INNER JOIN scdat.A_SECS_BUSINESS_CLASS_TS sb
ON sb.SEC_REF = t.SEC_REF
where t.TRADE_DATE >= to_char(start_date ,'DD-MON-YYYY')
and t.TRADE_DATE < to_char(end_date ,'DD-MON-YYYY')
and ct.COST_NAME = 'Broker commission'
and sb.BUSINESS_CLASS_DEFINITION = 'FTSE';
END; -
Statement closed when using callable statements with oracle xe
hi all, i've got this problem with oracle express edition 10g. I am using also oc4j v10.1.2.0.2. When working with a normal oracle database it was working fine (i think the code was the same, it's some time since i last tried, but you can see the code is very simple).
So i just create a callable statement like this:
CallableStatement cs = con.prepareCall(sentencia.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE, ResultSet.HOLD_CURSORS_OVER_COMMIT);
and then when trying to access the statement to register an out parameter like this
cs.registerOutParameter(1, parámetros[0].getTipo());
it gives this error:
java.sql.SQLException: Statement was closed
It's puzzling me because, as i said before, i think the same code was working ok with a normal oracle database.
Any idea what can it be?
cheersAh okay, sorry I've re-read your post.
I believe you need to create a clob object that encapsulates your xml file.
I've never done this but I would image it involves creating a class that implements the clob interface and passing an instantiation of this class to the callablestatement.
Let me know how you get on. -
JReport Designer - oracle stored procedure-PLS HELP!!!!
Hi,
I am using Jreport designer with oracle data base. I wanted to layout a report with oracle stored procedure which returns a REF CURSOR. I tried adding OracleProcedureUDS in user data source thru catalog browser. I gave the params as DRIVER=oracle.jdbc.driver.OracleDriver&URL="jdbc:oracle:thin:@10.10.1.177:1521:ORCL"
&USER=<myuser>&PSWD=<mypwd>&PROCNAME=empquery&SQL={ call empquery(?) }
&REFCURSORINDEX=1
but on pressing OK, i get the error ,
java.lang.NullPointerException
at jet.datasource.oracle.OracleProcedureUDS.getProcedureParams(jet/datas
ource/oracle/OracleProcedureUDS)
at jet.datasource.oracle.OracleProcedureUDS.getResultSet(jet/datasource/
oracle/OracleProcedureUDS)
at jet.universe.engine.UUDSEngine._getResultSet(jet/universe/engine/UUDS
Engine)
at jet.universe.engine.UQueryEngine.getResultSet(jet/universe/engine/UQu
eryEngine)
at jet.rptengine.JReportEngine.run(jet/rptengine/JReportEngine)
at java.lang.Thread.run(Thread.java:536)
java.lang.NullPointerException
at jet.datasource.oracle.OracleProcedureUDS.getProcedureParams(jet/datas
ource/oracle/OracleProcedureUDS)
at jet.datasource.oracle.OracleProcedureUDS.getResultSet(jet/datasource/
oracle/OracleProcedureUDS)
at jet.universe.engine.UUDSEngine._getResultSet(jet/universe/engine/UUDS
Engine)
at jet.universe.engine.UQueryEngine.getResultSet(jet/universe/engine/UQu
eryEngine)
at jet.rptengine.JReportEngine.run(jet/rptengine/JReportEngine)
at java.lang.Thread.run(Thread.java:536)
note: I have added the classpath C:\oracle\ora92\jdbc\lib\class111.zip which contains the classes in package oracle.jdbc.driver, as per the user guide.
also this is my stored procedure which got created successfully:
CREATE OR REPLACE PACKAGE SHDEMO as
type curtype is ref cursor;
END SHDEMO;
CREATE OR REPLACE PROCEDURE empquery (cur OUT SHDEMO.curtype) as
lcur SHDEMO.curtype;
begin
open lcur for
select * from intf_hr_employee;
cur:=lcur;
END empquery;
pls somebody help me. I have wasted 2 days on this.
Thanks,
SwathiHi,
i fixed the bug. it was because i excluded &OWNER=<MYOWNER> in the param list.
Thanks,
Swathi -
Reporting off oracle stored procedure with parameters error
Erorr message: Error in File xxx.rpt: Failed to retrieve data from the database. Details: [Database Vendor Code: 907 ]
Asp.net 2.0 web application.
CR XI R2 sp2 in BOE XI R2 sp2 on Solaris 10.
Database: Oracle 10g on Solaris 10. Oracle stored procedure defined in package.
Happens with reports reporting off stored procedure with parameters.
The sp is used in the crystal report.
The web application passes parameters to crystal report, which then passes the parameters to stored procedure.
Encountered error if:
r.PromptOnDemandViewing = false;
r.UseOriginalDataSource = false;
r.CustomServerType = CeReportServerType.ceServerTypeOracle;
Report can retrieves data if:
r.PromptOnDemandViewing = false;
r.UseOriginalDataSource = true;
r.CustomServerType = CeReportServerType.ceServerTypeOracle;
In addition
The steps are:
1) Create oracle package and stored proc.
2) In CR Designer, select the stored proc as datasource.
3) The parameters names were "generated" by the CR Designer.
4) Rename the parameter names.
5) Drag the fields onto report.
We noticed the following with different setting of database logon info:
When previewing from BOE, get error when "Use custom database logon information specified here"
However, no error when "Use original database logon information from the report".
Am i missing something?Please re-post if this is still an issue to the Data Connectivity - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly
-
Errors in calling Oracle stored procedure using java CallableStatement
Hello,
I have an oracle stored procedure below, it has been tested in PL/SQL without errors. During testing, in_c_file_type="F"; out_n_seqno_freeformat=120139596 and out_n_seqno_commaseprated is null (empty in value column).
When I run the program in Eclipse (windows xp), error messages is below: (It stopped at line 'cstme.execute();' )
Message:ORA-06550: line 1, column 26: PLS-00103: Encountered the symbol "" when expecting one of the following: . ( ) , * @ % & | = - + < / > at in is mod remainder not range rem => .. <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ as between from using || indicator multiset member SUBMULTISET_ The symbol ", was inserted before "" to continue. Error code:6550 SQL statement:65000 {code} Does anyone know what cause the error? It seems like something is missing in the stored procedure. But the stored procedure passes the test in the PL/SQL. The oracla driver I used is Oracle thin driver. Oracle version is 10.2.g Thanks in advance. northcloud {code} create or replace procedure SP_GET_SEQNO_2( in_c_file_type in char, out_n_seqno_freeformat out integer, out_n_seqno_commaseprated out integer) is n_seqno_commaseprated integer; n_seqno_freeformat integer; begin if in_c_file_type ='F' THEN SELECT message_counter.nextval INTO n_seqno_freeformat FROM dual; insert into temp_stroperations (record_id,OUTPUT_STR,INPROCESS_STR) values (n_seqno_freeformat,empty_clob(),empty_clob()); elsif in_c_file_type ='C' THEN SELECT message_counter.nextval INTO n_seqno_commaseprated FROM dual; insert into temp_stroperations (record_id,OUTPUT_STR,INPROCESS_STR) values (n_seqno_commaseprated,empty_clob(),empty_clob()); else SELECT message_counter.nextval INTO n_seqno_freeformat FROM dual; insert into temp_stroperations (record_id,OUTPUT_STR,INPROCESS_STR) values (n_seqno_freeformat,empty_clob(),empty_clob()); SELECT message_counter.nextval INTO n_seqno_commaseprated FROM dual; insert into temp_stroperations (record_id,OUTPUT_STR,INPROCESS_STR) values (n_seqno_commaseprated,empty_clob(),empty_clob()); end if; out_n_seqno_freeformat := n_seqno_freeformat; out_n_seqno_commaseprated := n_seqno_commaseprated; end SP_GET_SEQNO_2; {code} ----- A part of java code I used to call the stored procedure is here. {code} String escapeString = "{call SP_GET_SEQNO_2 (? ? ?)}"; CallableStatement cstme = null; try { cstme = con.prepareCall(escapeString); cstme.setString(1, "F"); cstme.registerOutParameter(2, java.sql.Types.INTEGER); cstme.registerOutParameter(3, java.sql.Types.INTEGER); cstme.execute(); int seqNoFreeformat=0, seqNocommasepreted=0; seqNoFreeformat = cstme.getInt(2); seqNocommasepreted = cstme.getInt(3); System.out.println ("In ConvertXML.processStoredProcedure(), seqNoFreeformat= "+seqNoFreeformat+";seqNocommasepreted="+seqNocommasepreted); } catch (SQLException e) { //System.out.println ("In ConvertXML.processStoredProcedure(), SQLException: "+e); System.err.println("Message:"+e.getMessage()); System.err.println("Error code:"+e.getErrorCode()); System.err.println("SQL statement:"+e.getSQLState()); log.log(Level.INFO, log.getName() + " - SQLException : "+e); } {code}es5f2000 wrote:
jschell wrote:
That works?I dunno. The below definitely works, but like I said, I've only
ever done it with one output parameter (and that has always
been a ResultSet).
String callableQuery = "{?= call my_package.my_call(?, ?)}"
Yes I have done that and at least in terms of my code it wasn't just a result set.
But not with two. -
Error Calling Oracle Stored Procedure From Within Report
Hi,
I have a report that calls an oracle stored procedure which returns a ref cursor. The report is working ok in our development environment when called from our development website through .NET.
When the report is moved and accessed from our UAT website we get the following error :-
Failed to open a rowset. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for Oracle Description: One or more errors occurred during processing of command. Failed to open a rowset. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for Oracle Description: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'RHS_GET_CAND_SECTION_REFS' ORA-06550: line 1, column 7: PL/SQL: Statement ignored Native Error: Failed to open a rowset. Error in File C:\WINDOWS\TEMP\temp_d663a952-bef6-4bf7-bf1a-5e288afdb612 {9B6DFB38-A436-4940-9D80-B4C23DFFFF19}.rpt: Failed to open a rowset.
If we open the report manually we are prompted to enter database connection info. If we enter the UAT connection details the report runs ok. If we save the report and try to open it from UAT website through .NET it now opens ok.
If we then move that same report back to the development environment and open from our development website it fails with the same error above.
Both connections are using Microsoft OLE DB drivers and the Oracle databases are the same version (10.2.0.1.0).
Is the connection information being stored in actual report and somehow being used when the report is opened through .NET?
Any help appreciated
Regards
PaulHi,
Please let me know if the issue occurs with the crystal reports designer, if you are facing issues with the .NET application then a need to create a post [here|SAP Crystal Reports, version for Visual Studio;.
Regards,
Hitesh -
Problem with calling a oracle stored procedure
Hi,
I am using the following callable statement to invoke a oracle stored procedure/function.
String myCallableStmt="{?=call IB_DDL.CREATE_DATASET(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
But I am getting the following errors which do not make sense to me
Exception in thread "main" java.lang.NullPointerException
at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:870)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:956)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1159)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3284)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3389)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4222)
at org.jtdemo.CreateDataSet.callCreateDatasetProcedure(CreateDataSet.java:246)
at org.jtdemo.Main.main(Main.java:29)
Can anyone help me here.
Thanks in advance
KalyanMay be I have used the word "procedure" loosely. Its infact a oracle function which returns a message of type Varchar2. Hence "{?=.....} here is used for registering the return value from the function. The remaining statement CREATE_DATASET(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?), here the first 14 are input parameters whereas the last one is the OUT parameter of the function. Hope this helps. Anways I am pasting my code below...
CallableStatement cstmt = null;
String myCallableStmt="{?=call IB_DDL.CREATE_DATASET(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
try {
System.out.print("Creating DataSet.......\n");
cstmt = targetCon.prepareCall(myCallableStmt);
cstmt.setObject("USER_ID_IN",this.USER_ID_IN);
cstmt.setObject("TABLE_NAME_IN",this.TABLE_NAME_IN);
cstmt.setObject("LAYOUT_IN",this.layoutCollection);
cstmt.setObject("DATA_TABLESPACE_IN",this.DATA_TABLESPACE_IN);
cstmt.setObject("INDEX_TABLESPACE_IN",this.INDEX_TABLESPACE_IN);
cstmt.setObject("STRING_POOL_NAME_IN",this.STRING_POOL_NAME_IN);
cstmt.setObject("NUMBER_POOL_NAME_IN",this.NUMBER_POOL_NAME_IN);
cstmt.setObject("DATE_POOL_NAME_IN",this.DATE_POOL_NAME_IN);
cstmt.setObject("LINK_POOL_NAME_IN",this.LINK_POOL_NAME_IN);
cstmt.setObject("DATASET_LEVEL_CONSTR_TYPE",this.DATASET_LEVEL_CONSTR_TYPE);
cstmt.setObject("DATASET_LEVEL_CONSTR_BODY",this.DATASET_LEVEL_CONSTR_BODY);
cstmt.setObject("POOLING_IN",this.POOLING_IN);
cstmt.setObject("SEGMENTATION_IN",this.SEGMENTATION_IN);
cstmt.setObject("DATASET_PARTITIONING_IN",this.DATASET_PARTITIONING_IN);
cstmt.registerOutParameter("DATASET_ID_OUT",OracleTypes.INTEGER);
cstmt.registerOutParameter("RETURN_MESSAGE",OracleTypes.VARCHAR);
cstmt.execute();
String returnMessage = (String)cstmt.getObject("RETURN_MESSAGE");
System.out.print(returnMessage);
}catch(SQLException e) {
e.printStackTrace();
} -
Oracle Stored Procedure with out parameter
Good morning,
Is it possible to use an Oracle stored procedure with out parameters in MII ?
If yes, what is the manipulation to see the values of parameters Out?
Thank youMichael,
This is the MII query template :
DECLARE
STRCOMPTERENDU NVARCHAR2(200);
BEGIN
STRCOMPTERENDU := NULL;
XMII.SP_VALIDATEPROCESSORDERSLIST2 ( STRCOMPTERENDU => [Param.1] );
COMMIT;
END;
and the stocked procedure code
CREATE OR REPLACE PROCEDURE XMII.SP_ValidateProcessOrdersList2(strCompteRendu OUT nVarchar2) IS
tmpVar NUMBER;
debugmode INT;
strClauseSql varchar(2048);
strListPOactif varchar(1024);
dtmTimeStamp DATE;
NAME: SP_ValidateProcessOrdersList
PURPOSE:
REVISIONS:
Ver Date Author Description
1.0 18/06/2008 1. Created this procedure.
NOTES:
Automatically available Auto Replace Keywords:
Object Name: SP_ValidateProcessOrdersList
Sysdate: 18/06/2008
Date and Time: 18/06/2008, 18:45:32, and 18/06/2008 18:45:32
Username: (set in TOAD Options, Procedure Editor)
Table Name: (set in the "New PL/SQL Object" dialog)
BEGIN
tmpVar := 0;
debugmode := 0;
-- lecture date systeme pour time stamp
select sysdate into dtmTimeStamp from dual;
if debugmode = 1 then
DBMS_OUTPUT.put_line('SP_ValidateProcessOrdersList');
end if;
-- insertion du bloc dans le log
insert into LOG_ORDER
(DATE_ORDER,BLOCK_ORDER,ID_LOG_ORDER)
values
(dtmTimeStamp,'SP_ValidateProcessOrdersList',ID_LOG_ORDER.nextval);
Commit;
if debugmode = 1 then
DBMS_OUTPUT.put_line('insertion LOG OK');
end if;
strCompteRendu := '0123456-896;0123456-897';
commit;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
ROLLBACK;
-- insertion du bloc dans le log
insert into LOG_ORDER
(DATE_ORDER,BLOCK_ORDER,ID_LOG_ORDER)
values
(dtmTimeStamp,' ',ID_LOG_ORDER.nextval);
COMMIT;
-- Consider logging the error and then re-raise
RAISE;
END SP_ValidateProcessOrdersList2;
Thanks for your help
Alexandre
Maybe you are looking for
-
Oracle 8.1.5 client
In the process of migrating database from 7.3.4 to 8.1.5. How can I setup a silent install to install oracle 8.1.5 client software on numerous client windows desktops so that the 7.3.4 and 8.1.5 client side by side? null
-
Pdf crop marks disappear!
Hi, I am currently receiving pdf files of ads which will feature in a magazine. I'm using QXP to bring the mag together. When I import some of the pdfs some of the ads look like they are trimmed to the page size, but when I open the pdf the trim mark
-
Quicktime has expanded all my FCP video files. Files that were previously normal size, made over two years ago, have become large files (ie...2.5 gigs turned into 20 gigs) without any processing. When capturing I'm also experiencing large file sizes
-
.CNT (TOC) Issues
HELP. I'm using WinHelp 2000. I have tried all the suggestions and I still can't get new topics (and books) to show up after I compile it under CONTENTS. The topics show in the TOC when I'm working in Robohelp, but they don't show in the contents. Th
-
Regarding Voting disk recovery scenarios
Hi, For years i have read about RAC and Voting disk and it is said that each node should access more than half of the voting disks but never got a chance to work on the below scnerios which i have mentioned, if some one has practical done the below s