Help required in executing the stored procedure and capturing the responce
Hi,
I have to execute a stored procedure in oracle database and if it successful then have to create a status IDOC.
The stored procedure may throw an exception(it is not an out parameter), in such cases i should capture the exception as part of the response message and send this information while creating the status IDOC.
i would like if the below is possible.
As the stored procedure is not returning( this means if you execute the procedure manually it will display the result), will it be possible to capture the result which has the exception details?
any direction to this will be highly appreciated.
Many thanks.
Regards,
Rahul
@Bhaskar,
i need to execute the procedure by sending the input data from a file and capture the result after executing the procedure to create a status idoc
im not sure how the provided links helps me here.
i m not looking for any look ups. i would like to know is there any way that we can capture the result after executing the database procedure?
Edited by: Rahul_10416 on Dec 5, 2011 10:07 PM
Similar Messages
-
How to call the stored procedure in side the package... ?
Hi
I have one package i am new to PL/SQL. I want to execute the package and procedure.
CREATE OR REPLACE PACKAGE BODY Employee_pkg
AS
PROCEDURE GetEmployeeName(i_empno IN NUMBER,
o_ename OUT VARCHAR2)
IS
BEGIN
SELECT ename
INTO o_ename
FROM emp
WHERE empno = i_empno;
END GetEmployeeName;
END Employee_pkg;
Please tell me how to execute the package. and inside procedure
ThanksSQL> create package employee_pkg
2 as
3 procedure getemployeename(i_empno in number, o_ename out varchar2);
4 end employee_pkg;
5 /
Package is aangemaakt.
SQL> CREATE OR REPLACE PACKAGE BODY Employee_pkg
2 AS
3 PROCEDURE GetEmployeeName(i_empno IN NUMBER,
4 o_ename OUT VARCHAR2)
5 IS
6 BEGIN
7 SELECT ename
8 INTO o_ename
9 FROM emp
10 WHERE empno = i_empno;
11 END GetEmployeeName;
12
13
14 END Employee_pkg;
15 /
Package-body is aangemaakt.
SQL> var P_ENAME varchar2(30)
SQL> set autoprint on
SQL> exec employee_pkg.getemployeename(7839,:P_ENAME)
PL/SQL-procedure is geslaagd.
P_ENAME
KINGRegards,
Rob. -
Stored procedure and peoplecode in app engine
Hey all,
i want to call a stored procedure in peoplecode using sqlexec. i guess the following syntax is correct.
sqlexec("exec sp_name");
my question is
will the peoplecode wait until the stored procedure completes?
or
will it just send the command to database to execute the stored procedure and continue executing the next statements after the sql exec.
Please let me know if i am not explain better and need to give an example.
Please help me.
thank you."...will the peoplecode wait until the stored procedure completes"
Yes.
Nicolas. -
Triggers, Stored Procedures and Java
Hi all.
I started developing some useful (at least for me) Java Package, and I'm wondering if I'm doing the right thing.
Let's say that I have a trigger that calls a Stored Procedure that calls a Java Package.
Let's say that the Java Package can be used by more than one Oracle Schema.
So, my question is:
Should I load the package in every Schema ? Or should I load the package in the System (for instance) schema, creating synonyms for it (if possible) ? Or should I create both the package and the Stored Procedure in System, creating synonyms for the procedure ?
I'm a little stuck in this....
Another question : when my trigger fires, it launch the Stored Procedure and, consequently, my Java Package.... At this point, am I in the same transaction of the trigger ? Or the Java Package start a new "subtransaction" ?
Thanks in advance for Your help.
Best Regards
Fabio GRANDEDo not create anything in the System schema. Create the package and procedure in one schema and create a public synonym that the other schemas can use to access it.
And yes the trigger and anything it executes are all part of the same transaction. As long as none of the procedures are declared as an autonomous transaction, in which case that procedure would be a separate transaction. -
Dynamically calling stored procedure and getting result set c++
Hello,
I am trying to write some c++ code that will dynamically bind values to a stored procedure and excute the procedure and get back a resultset. The problem I am running into is how to get back the resultset. Any help or example would be highly appreciated.int main(int argc, char* argv[])
OCIError* pOciError;
char* pConnectChar = "dbname";
char* pUsernameChar = "scott";
char* pPasswordChar = "tiger";
int answer;
OCIStmt* pOciStatement;
char* sqlCharArray = "BEGIN :success := sp_ListEmp; END;";
int id;
char ename[40];
OCIEnv* g_pOciEnvironment = NULL;
OCIServer* g_pOciServer = NULL;
OCISession* g_pOciSession = NULL;
OCISvcCtx* g_pOciServiceContext = NULL;
sb2* pIndicator=0;
sb2* pIndicator2=0;
sb2* pIndicator3=0;
OCIDefine* pOciDefine;
OCIDefine* pOciDefine2;
OCIBind* pBind;
OCIStmt* cursor;
answer = OCIInitialize(OCI_THREADED, NULL, NULL, NULL, NULL);
answer = OCIEnvInit(&g_pOciEnvironment, OCI_DEFAULT, 0, NULL);
answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&pOciError, OCI_HTYPE_ERROR, 0, NULL);
answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciSession, OCI_HTYPE_SESSION, 0, NULL);
answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciServer, OCI_HTYPE_SERVER, 0, NULL);
answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciServiceContext, OCI_HTYPE_SVCCTX, 0, NULL);
answer = OCIServerAttach(g_pOciServer, pOciError, (unsigned char *)pConnectChar, strlen(pConnectChar),
OCI_DEFAULT);
answer = OCIAttrSet(g_pOciSession, OCI_HTYPE_SESSION, (unsigned char *)pUsernameChar, strlen(pUsernameChar),
OCI_ATTR_USERNAME, pOciError);
answer = OCIAttrSet(g_pOciSession, OCI_HTYPE_SESSION, (unsigned char *)pPasswordChar, strlen(pPasswordChar),
OCI_ATTR_PASSWORD, pOciError);
answer = OCIAttrSet(g_pOciServiceContext, OCI_HTYPE_SVCCTX, g_pOciServer, 0, OCI_ATTR_SERVER, pOciError);
answer = OCIAttrSet(g_pOciServiceContext, OCI_HTYPE_SVCCTX, g_pOciSession, 0, OCI_ATTR_SESSION, pOciError);
answer = OCISessionBegin(g_pOciServiceContext, pOciError, g_pOciSession, OCI_CRED_RDBMS, OCI_DEFAULT);
answer = OCIHandleAlloc(g_pOciEnvironment, (void **)(&pOciStatement), OCI_HTYPE_STMT, 0, NULL);
answer = OCIStmtPrepare(pOciStatement, pOciError, (unsigned char *)sqlCharArray, strlen(sqlCharArray),
OCI_NTV_SYNTAX, OCI_DEFAULT);
answer = OCIHandleAlloc(g_pOciEnvironment, (void **)(&cursor), OCI_HTYPE_STMT, 0, NULL);
answer = OCIBindByPos(pOciStatement,&pBind, pOciError, 1, &cursor, 0,SQLT_RSET,
pIndicator2, 0,NULL, 0,0,OCI_DEFAULT);
answer = OCIStmtExecute(g_pOciServiceContext, pOciStatement, pOciError, 1, 0, NULL, NULL,
OCI_COMMIT_ON_SUCCESS);
answer = OCIDefineByPos(cursor,&pOciDefine, pOciError,2,&id,sizeof(int),
SQLT_INT,pIndicator, 0, 0,OCI_DEFAULT);
answer = OCIDefineByPos(cursor,&pOciDefine2, pOciError,1,ename,40,
SQLT_STR,pIndicator3, 0, 0,OCI_DEFAULT);
if (answer == 0)
while ((answer = OCIStmtFetch(cursor,pOciError, 1,OCI_FETCH_NEXT,OCI_DEFAULT)) == 0)
printf("fetched id %d and name %s\n",id,ename);
answer = OCIHandleFree(pOciError, OCI_HTYPE_ERROR);
return 0; -
Oracle stored Procedure and Packages in CR4E
Hi,
I want to use Stored Procedure in CR4E. I don't know how to use Stored Procedures and packages in Crystal Reports for Eclipse. In the data source explorer I can only see the Tables, Views and Stored Procedures but not packages from my Schema and when I can only drag & drop the Tables and Views into the Field Explorer, I can't drag & Drop the Stored Procedures.
I managed to attached the stored procedure from CR studio. I opened the report in CR4E and I can see the stored procedure and can preview the data. When I try to run the report and override the datasource, it throws oracle error saying "ORA-01008: Not all variables bound". When I tried to use the option
DBOptions._doNotVerifyDB
while replacing connection I get the this error
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
at java.lang.Boolean.compareTo(Boolean.java:26)
at com.crystaldecisions.sdk.occa.report.lib.ClonableMap.hasContent(ClonableMap.java:112)
at com.crystaldecisions.client.helper.CloneUtil.hasContent(CloneUtil.java:135)
at com.crystaldecisions.sdk.occa.report.data.ConnectionInfo.hasContent(SourceFile:151)
at com.crystaldecisions.client.helper.CloneUtil.hasContent(CloneUtil.java:135)
at com.crystaldecisions.sdk.occa.report.data.Table.hasContent(SourceFile:286)
at com.crystaldecisions.sdk.occa.report.data.Procedure.hasContent(SourceFile:212)
at com.crystaldecisions.sdk.occa.report.lib.ArrayListMerger.haveMatchingContent(ArrayListMerger.java:232)
at com.crystaldecisions.sdk.occa.report.lib.ArrayListMerger.mergePass(ArrayListMerger.java:138)
at com.crystaldecisions.sdk.occa.report.lib.ArrayListMerger.merge(ArrayListMerger.java:86)
at com.crystaldecisions.sdk.occa.report.lib.ControllableList.copyTo(ControllableList.java:68)
at com.crystaldecisions.sdk.occa.report.data.Database.copyTo(SourceFile:105)
at com.crystaldecisions.sdk.occa.report.lib.ControllableHelper.copyToPreservingReferences(ControllableHelper.java:153)
at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.a(SourceFile:2556)
at com.crystaldecisions.sdk.occa.report.application.b9.onDataSourceChanging(SourceFile:315)
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:971)
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:4078)
at com.crystaldecisions.sdk.occa.report.application.bv.new(SourceFile:121)
at com.crystaldecisions.sdk.occa.report.application.bv.int(SourceFile:91)
at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.performDo(SourceFile:151)
at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.a(SourceFile:106)
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:2159)
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.mapFields(SourceFile:4061)
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:3914)
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.replaceConnection(SourceFile:3880)
at
Please advice if Stored procedures and packages are supported in CR4E ?Hi, Jack76,
According to the [CR4E Release Notes|http://help.sap.com/businessobject/product_guides/cr4E/en/cr4e_relnotes_en.pdf] (available from the [CR4E Download page|http://www.businessobjects.com/campaigns/forms/downloads/crystal/eclipse/datasave.asp]), stored procedures are supported, as long as they don't use parameters that need null values.
I don't see any references to packages.
Bryan -
Execute a stored procedure in oracle sql developer
I write a procedure in a package it compiles fine, but why when I execute it from right click the stored procedure and then click Ok, nothing happens, I cannot see from any screen if it executed or not , or is it successful or not?
Thanks,What happens if you open the package in the editor and use the 'Execute' button on the toolbar?
You should be prompted with a pop-up dialog asking you to select your procedure/function and provide the necessary input values and hit the 'Ok' button. -
Can i use Stored procedures and triggers with SDK
hi all
How to use the stored procedure and Triggers with SDK, can i get a sample code
Regards
SalahHi, Salah.
Use "Exec" in your query to run procedures.
SAPbobsCOM.Recordset oRS;
oRS = (SAPbobsCOM.Recordset)pCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
oRS.DoQuery ("EXEC YourStoredProcName");
Triggers are not supported in SDK.
Regards,
Aleksey -
Hello,
I have a request to create a user login and restrict that user to only be able to execute a single stored procedure.
Is this possible using only TSQL commands?
Am i on the right track here?
USE MyDatabase
GO
CREATE LOGIN [mylogin] DEFAULT_DATABASE = [MyDatabase], CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF
GO
CREATE ROLE exec_single_proc_role
GO
exec sp_addrolemember 'exec_single_proc_role', 'mylogin'
GO
CREATE SCHEMA [restricted] AUTHORIZATION mylogin
GO
GRANT EXECUTE ON SCHEMA::restricted TO exec_single_proc_role
GOThanks for the reply.
This particular user should need to be able to Alter, Execute, and View the stored procedure as well.
Here is what i ended up with: Any improvement are appreciated. Thanks
USE MyDatabase
GO
--DROP SCHEMA
IF EXISTS (SELECT * FROM sys.schemas WHERE name = N'restricted')
DROP SCHEMA [restricted]
GO
--DROP SERVER WIDE LOGIN
IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N'MyUserLogin')
DROP LOGIN [MyUserLogin]
GO
--CREATE SERVER WIDE LOGIN
CREATE LOGIN [MyUserLogin] WITH PASSWORD = 0x0100F1CF6792E602EF40DFF55983FDE81A9 HASHED, SID = 0xC33B04EECE59DC4C95BE66ED9B15D13D, DEFAULT_DATABASE = [MyDatabase], CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF
GO
--DROP ROLE
DECLARE @RoleName sysname
set @RoleName = N'exec_single_proc_role'
IF EXISTS (SELECT * FROM sys.database_principals WHERE name = @RoleName AND type = 'R')
Begin
DECLARE @RoleMemberName sysname
DECLARE Member_Cursor CURSOR FOR
select [name]
from sys.database_principals
where principal_id in (
select member_principal_id
from sys.database_role_members
where role_principal_id in (
select principal_id
FROM sys.database_principals where [name] = @RoleName AND type = 'R' ))
OPEN Member_Cursor;
FETCH NEXT FROM Member_Cursor
into @RoleMemberName
WHILE @@FETCH_STATUS = 0
BEGIN
exec sp_droprolemember @rolename=@RoleName, @membername= @RoleMemberName
FETCH NEXT FROM Member_Cursor
into @RoleMemberName
END;
CLOSE Member_Cursor;
DEALLOCATE Member_Cursor;
End
IF EXISTS (SELECT * FROM sys.database_principals WHERE name = N'exec_single_proc_role' AND type = 'R')
DROP ROLE [exec_single_proc_role]
GO
--DROP USER
IF EXISTS (SELECT * FROM sys.database_principals WHERE name = N'MyUserLogin')
DROP USER [MyUserLogin]
GO
--CREATE USER AND ASSIGN DEFAULT SCHEMA
CREATE USER [MyUserLogin] FOR LOGIN [MyUserLogin] WITH DEFAULT_SCHEMA=[restricted]
GO
--CREATE SCHEMA
CREATE SCHEMA [restricted] AUTHORIZATION [MyUserLogin]
GO
--CREATE ROLE
CREATE ROLE [exec_single_proc_role] AUTHORIZATION [MyUserLogin]
GO
--ADD ROLE
EXEC sp_addrolemember 'exec_single_proc_role', [MyUserLogin]
GO
GRANT EXECUTE ON SCHEMA::[restricted] TO [exec_single_proc_role]
GO
GRANT EXECUTE ON OBJECT::[dbo].[MyStoredProcedure] TO [MyUserLogin]
GO -
Help me in calling stored procedure and getting results
hi
i have a SP like this
CREATE OR REPLACE PACKAGE P1 AS
TYPE g_con_ref_cursor is REF CURSOR ;
TYPE g_con_error IS RECORD
error_code NUMBER,
error_desc varchar2(2000)
PROCEDURE PROC_CURSOR
(i_str_userid IN VARCHAR2,
o_cur_ref_cur OUT g_con_ref_cursor,
o_rec_error OUT g_con_error,
o_num_status OUT NUMBER);
END;
and i now i am trying to call this SP using my java program
i am able to register the out put params for 2nd and 4 th variable
my doubt is how i can register the output param for g_con_errorand how i can get result from this ????
my java program is like this
Connection connection = DatabaseHelper.prepareConnection();
CallableStatement proc = connection.prepareCall("{ call P1.PROC_CURSOR(?, ?, ?, ?) }");
proc.setString(1,"jn26557");
proc.registerOutParameter(2,oracle.jdbc.driver.OracleTypes.CURSOR);
proc.registerOutParameter(3,Types.STRUCT,); //HOW TO SET THIS ?????
proc.registerOutParameter(4,oracle.jdbc.driver.OracleTypes.NUMERIC);
proc.execute();
plz help me in this
i have no idea how to do it
any help would be appreciated
Thanks in advance
Jaya Prakash NalajalaYou have the requirements to build the stored procedure, what have you got so far?
Post your attempt and any errors or issues that you might be experiencing. Writing the whole procedure for you (without the table structure even) is going to be difficult. -
Executing the stored procedure with output which is a collection of objects
Hello,
I have the objects and collection of objects within an objects as below:
CREATE OR REPLACE TYPE SHARE_OUTST_T
AS OBJECT
SHR_OUTST_AMT number
CREATE OR REPLACE TYPE SECURITY_T
AS OBJECT
VOTE_PER_SHR number
, CUSIP varchar2(12)
, EXCHANGE varchar2(10)
, IV_TYPE_CD varchar2(10)
, SEC_TICKER_SYMB varchar2(20)
CREATE OR REPLACE TYPE ALTERNATE_ID_T
AS OBJECT
( ALT_ID_TYPE varchar2(20)
CREATE OR REPLACE TYPE ISSUE_MAINT_VERSION_T
AS OBJECT
IM_KEY_ID number
, IM_VER_NUM number
, EFF_TMSTMP timestamp
, EXP_TMSTMP timestamp
, NEXT_REVIEW_TMSTMP timestamp
, APPR_STATUS_REF_ID number
, VOTE number
, ADD_USR_ID varchar2(20)
, ADD_TMSTMP timestamp
, UPD_USR_ID varchar2(20)
, UPD_TMSTMP timestamp
, LOCK_LEVEL_NUM number
, ACTION VARCHAR2(1)
CREATE OR REPLACE TYPE ISSUE_SHARE_MAINT_T
AS OBJECT
IM_KEY_ID number
, IM_VER_NUM number
, SHR_OUTST_AMT number
, CURR_OUTST_AMT number
, ADD_USR_ID varchar2(20)
, ADD_TMSTMP timestamp
, UPD_USR_ID varchar2(20)
, UPD_TMSTMP timestamp
, LOCK_LEVEL_NUM number
, ACTION VARCHAR2(1)
CREATE OR REPLACE TYPE ISSUE_MAINT_COMMENT_T
AS OBJECT
IM_KEY_ID number
, IM_VER_NUM number
, COMMENT_TXT varchar2(400)
, ADD_USR_ID varchar2(20)
, ADD_TMSTMP timestamp
, UPD_USR_ID varchar2(20)
, UPD_TMSTMP timestamp
, LOCK_LEVEL_NUM number
, ACTION VARCHAR2(1)
CREATE OR REPLACE TYPE ISSUE_MAINT_COMMENT_COL_T AS TABLE OF ISSUE_MAINT_COMMENT_T;
CREATE OR REPLACE TYPE ISSUE_VERSION_T
AS OBJECT
SHARE_OUTST SHARE_OUTST_T
, SECURITY SECURITY_T
, ALTERNATE_ID ALTERNATE_ID_T
, ISSUER ISSUER_T
, ISSUE_MAINT_VERSION ISSUE_MAINT_VERSION_T
, ISSUE_SHARE_MAINT ISSUE_SHARE_MAINT_T
, ISSUE_MAINT_COMMENT_COL ISSUE_MAINT_COMMENT_T
CREATE OR REPLACE TYPE ISSUE_VERSION_COL_T AS TABLE OF ISSUE_VERSION_T;
And the stored procedure as :
=======================================
PROCEDURE get_all_issue_version_col
( pv_issue_version_col OUT issue_version_col_t
AS
CURSOR cur_issue_version
IS
SELECT
issue_version_t (
SHARE_OUTST_T (so.shr_outst_amt )
, SECURITY_T ( s.vote_per_shr
, s.sec_cusip
, s.PRI_MKT_EXCH_CD
, s.IV_TYPE_CD
, s.SEC_TICKER_SYMB )
, ALTERNATE_ID_T (a.ALT_ID_TYPE)
, ISSUER_T (i.ISSR_ID )
, ISSUE_MAINT_VERSION_T (imv.im_key_id
, imv.im_ver_num
, imv.eff_tmstmp
, imv.exp_tmstmp
, imv.next_review_tmstmp
, imv.appr_status_ref_id
, imv.vote
, imv.add_usr_id
, imv.add_tmstmp
, imv.upd_usr_id
, imv.upd_tmstmp
, imv.lock_level_num
, NULL )
, ISSUE_SHARE_MAINT_T (ism.im_key_id
, ism.im_ver_num
, ism.shr_outst_amt
, ism.curr_outst_amt
, ism.add_usr_id
, ism.add_tmstmp
, ism.upd_usr_id
, ism.upd_tmstmp
, ism.lock_level_num
, NULL)
, ISSUE_MAINT_COMMENT_T(imc.im_key_id
, imc.im_ver_num
, imc.comment_txt
, imc.add_usr_id
, imc.add_tmstmp
, imc.upd_usr_id
, imc.upd_tmstmp
, imc.lock_level_num
, NULL )
FROM
share_outst so
, security s
, alternate_id a
, issuer i
, issue_maintenance_version imv
, issue_share_maintenance ism
, issue_maintenance_comment imc
WHERE
s.sec_key_id = so.SEC_KEY_ID
and s.SEC_KEY_ID = a.SEC_KEY_ID
and s.MSTR_ISSR_KEY_ID = i.ISSR_KEY_ID
and s.SEC_CUSIP = imv.SEC_CUSIP (+)
and s.SEC_CUSIP = ism.SEC_CUSIP (+)
and imv.IM_KEY_ID = imc.IM_KEY_ID (+);
BEGIN
OPEN cur_issue_version ;
FETCH cur_issue_version BULK COLLECT INTO pv_issue_version_col ;
CLOSE cur_issue_version ;
END ;
PROCEDURE get_all_issue_col_v1
( pv_issue_version_col OUT NOCOPY issue_version_col_t
, pv_row_count IN number
, pv_issuer_id IN VARCHAR2
AS
CURSOR cur_issue_version
IS
SELECT
issue_version_t (
SHARE_OUTST_T (so.shr_outst_amt )
, SECURITY_T ( s.vote_per_shr
, s.sec_cusip
, s.PRI_MKT_EXCH_CD
, s.IV_TYPE_CD
, s.SEC_TICKER_SYMB )
, ALTERNATE_ID_T (a.ALT_ID_TYPE)
, ISSUER_T (i.ISSR_ID )
, ISSUE_MAINT_VERSION_T (imv.im_key_id
, imv.im_ver_num
, imv.eff_tmstmp
, imv.exp_tmstmp
, imv.next_review_tmstmp
, imv.appr_status_ref_id
, imv.vote
, imv.add_usr_id
, imv.add_tmstmp
, imv.upd_usr_id
, imv.upd_tmstmp
, imv.lock_level_num
, NULL )
, ISSUE_SHARE_MAINT_T (ism.im_key_id
, ism.im_ver_num
, ism.shr_outst_amt
, ism.curr_outst_amt
, ism.add_usr_id
, ism.add_tmstmp
, ism.upd_usr_id
, ism.upd_tmstmp
, ism.lock_level_num
, NULL)
, ISSUE_MAINT_COMMENT_T(imc.im_key_id
, imc.im_ver_num
, imc.comment_txt
, imc.add_usr_id
, imc.add_tmstmp
, imc.upd_usr_id
, imc.upd_tmstmp
, imc.lock_level_num
, NULL )
FROM
share_outst so
, security s
, alternate_id a
, issuer i
, issue_maintenance_version imv
, issue_share_maintenance ism
, issue_maintenance_comment imc
WHERE
s.sec_key_id = so.SEC_KEY_ID
and s.SEC_KEY_ID = a.SEC_KEY_ID
and s.MSTR_ISSR_KEY_ID = i.ISSR_KEY_ID
and s.SEC_CUSIP = imv.SEC_CUSIP (+)
and s.SEC_CUSIP = ism.SEC_CUSIP (+)
and imv.IM_KEY_ID = imc.IM_KEY_ID (+);
BEGIN
OPEN cur_issue_version ;
FETCH cur_issue_version BULK COLLECT INTO pv_issue_version_col ;
CLOSE cur_issue_version ;
END ;
====================
When I execute this stored procedure thru rapid sql, I get error
Error: ORA-06550: line 1, column 21:
PLS-00306: wrong number or types of arguments in call to 'GET_ALL_ISSUE_VERSION_COL'
ORA-06550: line 1, column 21:
PL/SQL: Statement ignored, Batch 1 Line 1 Col 21
What is that I am missing?
Any help would be greatly appreciated.I've never tried Rapid SQL, but my guess is that you can't pass objects through it. I'd write a test case on the server and try it there. It looks like it should work but I didn't build a test case. If it works on the server but not in the tool, it's like the tool. OCI8 doesn't support passing instantiated objects.
-
How can I get a list of values (one or more) used in the WHERE filter of stored procedures and functions in SQL Server?
How can get a list of values as shown (highlighted) in the sample stored procedure below?
ALTER PROC [dbo].[sp_LoanInfo_Data_Extract] AS
SELECT [LOAN_ACCT].PROD_DT,
[LOAN_ACCT].ACCT_NBR,
[LOAN_NOTE2].OFCR_CD,
[LOAN_NOTE1].CURR_PRIN_BAL_AMT,
[LOAN_NOTE2].BR_NBR,
INTO #Table1
FROM
dbo.[LOAN_NOTE1],
dbo.[LOAN_NOTE2],
dbo.[LOAN_ACCT]
WHERE
[LOAN_ACCT].PROD_DT = [LOAN_NOTE1].PROD_DT
and
[LOAN_ACCT].ACCT_NBR = [LOAN_NOTE1].ACCT_NBR
and
[LOAN_NOTE1].PROD_DT = [LOAN_NOTE2].PROD_DT
and
[LOAN_NOTE1].MSTR_ACCT_NBR = [LOAN_NOTE2].MSTR_ACCT_NBR
and
[LOAN_ACCT].PROD_DT = '2015-03-10'
and
[LOAN_ACCT].ACCT_STAT_CD IN
('A','D')
and
[LOAN_NOTE2].LOAN_STAT_CD IN
('J','Z')
LenfinkelHi LenFinkel,
May I know what is purpose of this requirement, as olaf said,you may parse the T-SQL code (or the execution plan), which is not that easy.
I have noticed that the condition values in your Stored Procedure(SP) are hard coded and among them there is a date values, I believe some day you may have to alter the SP when the date expires. So why not declare 3 parameters of the SP instead hard coding?
For multiple values paramter you can use a
table-valued parameter. Then there's no problem getting the values.
If you could elaborate your purpose, we may help to find better workaround.
Eric Zhang
TechNet Community Support -
I need Help with the stored procedure
Hello, I new with VS.Net
I'm tring to call a stored procedure, but when i try to retrive the data don't return nothing.
my VB code is the follows
ocm_comando.Connection = ocn_coneccion
ocm_comando.CommandText = "WPROC_PRUEBA"
ocm_comando.CommandType = CommandType.StoredProcedure
ocm_comando.Parameters.Add("PNI_ID_ESTUDIO", OracleDbType.Decimal).Direction = ParameterDirection.Input
ocm_comando.Parameters("PNI_ID_ESTUDIO").Value = CType(vc_id_estudio, Integer)
ocm_comando.Parameters.Add("pco_precalificada", OracleDbType.Varchar2).Direction = ParameterDirection.Output
ocm_comando.Parameters.Add("pco_resultado", OracleDbType.Varchar2).Direction = ParameterDirection.Output
Txb_empresa.Text = ocm_comando.Parameters("pco_precalificada").Value
My stored procedure only take the parameter that I sent and make a simple select and return the value in the variable pco_precalificada
thank for your help
**** Sorry for mi EnglishYou forgot to actually execute the command. Before the last line, where you ask for the value of pco_precalificada, you need to:
1. Open the connection (if it's not already open)
2. Call ocm_comando.ExecuteNonQuery()
HTH,
Tom -
Error executing a stored procedure from SSIS using the MERGE statement between databases
Good morning,
I'm trying to execute from SSIS a stored procedure that compares the content of two tables on different databases in the same server and updates one of them. To perform this action, I've created a stored procedure in the destination database and I'm
comparing the data between tables with the MERGE statement. When I execute the procedure on the destination database the error that I obtain is:
"Msg 916, Level 14, State 1, Procedure RefreshDestinationTable, Line 13
The server principal "XXXX" is not able to access the database "XXXX" under the current security context."
Some things to take in account:
1. I've created a temporary table on the same destination database to check if the problem was on the MERGE statement and it works fine.
2. I've created the procedure with the option "WITH EXECUTE AS DBO".
I've read that it can be a problem of permissions but I don't know if I'm executing the procedure from SSIS to which user/login I should give permissions and which.
Could you give me some tip to continue investigating how to solve the problem?
Thank you,
VirgilioRead Erland's article http://www.sommarskog.se/grantperm.html
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Is it possible to execute a stored procedure using the JDBC adapter?
Hi all,
Can anybody confirm whether we can execute a stored procedure created in a database using the processing parameters of a JDBC adapter of a communication channel?
If yes, then please let me know how (may be with an example)
Thanks.Yes, that is possible. You have to chose EXECUTE in the action field to execute the stored procedure. Here's a little piece on the JDBC receiver:
JDBC Receiver
For writing data to an SQL database you also need to define a strict data type. The general format is like this:
<ns:MT_RECORDSET>
<STATEMENT>
<TABLE_NAME ACTION="">
<TABLE/>
<ACCESS>
<FIELD1/>
<FIELD2/>
<FIELDn/>
</ACCESS>
<KEY>
<ID compareOperation=""/>
<FIELDx compareOperation=""/>
</KEY>
</TABLE_NAME>
</STATEMENT>
</ns:MT_RECORDSET>
This recordset represents an SQL statement like "update TABLE1 set FIELD1=123, FIELD2=456, FIELDn='xyz' where ID=12345 and FIELDx is NULL"
MT_RECORDSET is the name of the Message Type used.
For the value of the attribute ACTION you can choose from the following values:
UPDATE : updates the given fields in the table with their new values
INSERT : insert the given fields as a new row in the table
UPDATE_INSERT : insert rows in the table when update is not possible
DELETE : deletes given fields from the table
SELECT : selects given fields from the table. Note that this option returns a response in the JDBC Sender form!
EXECUTE : execution of a stored SQL procedure
SQL_QUERY | SQL_DML : option to transfer more complex SQL statements to the database
The attribute compareOperation can have the following values:
EQ : equal
NEQ : not equal
LT : less than
LTEQ : less than or equal to
GT : greater than
GTEQ : greater than or equal to
LIKE : used to compare strings
Maybe you are looking for
-
Why can I not sign in and download my new copy of photoshop elements 12
Why can't I download my new program---first it asks for my adobe ID--which I give it and then it says not recognized--so I try and try and try again--changing the password--then it asks for a serial number and gives me 24 spaces--but the serial numbe
-
Imovie won't open since upgrade to Mountain Lion
Just upgraded to Mountain Lion and now Imovie won't open. It tries, but then shuts down with error message. Tried repairing disk permissions and rebooting. Any Help appreciated.
-
Friends, i have a problem with safari . Whenever i am typing in the safari main bar , so in the halfway through the typing my sentence/words are shifting to another main google search and in the end i have to type again in google. I have attached a
-
Hi, I have building a program that will have one split screen and one of them has cl_column_tree_mode at top, and the other has cl_gui_alv_grid at bottom. I can Drag And Drop Lines From ALV GRID to TREE and i can use ONDRAG event of ALVGRID, DROP eve
-
External Display flashes when attached via DVI to MBP
When I attach the Samsung Syncmaster 204B to my MBP running 10.5.4, the external screen appears for about 5 mins and then it randomly flashes off and on. The only property that can be adjusted form the MBP is the resolution. Does anyone have any hint