Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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.

A man and a dog have an average of three legs.

Beaware of Statistics.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...