returning into oracle c#

ace333

Member
Joined
Jul 19, 2005
Messages
22
CREATE OR REPLACE PROCEDURE WES_UAT.P_INS_EMAIL
(
param_sendTo IN EMAIL.SENDTO%TYPE,
param_sendFrom IN EMAIL.SENDFROM%TYPE,
param_subject IN EMAIL.SUBJECT%TYPE,
param_format IN EMAIL.BODYFORMAT%TYPE,
param_priority IN EMAIL.PRIORITY%TYPE,
param_body IN EMAIL.EMAILBODY%TYPE,
param_errorEmailAddress IN EMAIL.ERROREMAILADDRESS%TYPE,
param_ccEmailAddress IN EMAIL.CCEMAILADDRESS%TYPE,
param_systemName IN EMAIL.SYSTEMNAME%TYPE
)
IS

BEGIN
INSERT INTO EMAIL(
ID,
SENDTO,
SENDFROM,
SUBJECT,
EMAILBODY,
BODYFORMAT,
PRIORITY,
LASTUPDATED,
PROCESSEDFLAG,
ERROREMAILADDRESS,
CCEMAILADDRESS,
SYSTEMNAME,
INPUTDATE
)
VALUES(
SEQ_EMAIL_ID .NEXTVAL,
param_sendTo,
param_sendFrom,
param_subject,
param_body,
param_format,
param_priority,
SYSDATE,
N,
param_errorEmailAddress,
param_ccEmailAddress,
param_systemName,
SYSDATE
)
returning id into GLOBALS.i
;
END;

This is an oracle stored proc

How do I read the value i from the stored proc from c#, when i do the insert i want to be able to get the id associated with that insert
 
Declare one more stored procedure parameter as an out parameter for example:
param_ID OUT NUMBER

and then...
RETURNING ID INTO param_ID;

...and then you can read param_ID value in your c# function.
 
Back
Top