If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Stored Procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-16-11, 03:46
stahorse1 stahorse1 is offline
Registered User
 
Join Date: Nov 2011
Posts: 13
Stored Procedure

Hi

I have a database table App, with a primary key,AppID. So I need to insert Data in App, which will auto generate AppID.

My Store Procedure goes something like this:

AppID IN NUMBER
, PersonID IN NUMBER
, ContractorID IN NUMBER
, erfNo IN VARCHAR2
, streetNo IN VARCHAR2

so I need a code to return AppID.

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 11-16-11, 04:38
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
I'd use a sequence. As it generates values automatically, no stored procedure is needed at all.

Anyway: if you insist on a stored procedure and returning generated APPID (where to?), you'd have to create an OUT parameter.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On