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 > Data Access, Manipulation & Batch Languages > ANSI SQL > How to return a result from a procedure?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-11-03, 15:40
lanli@nrcan.gc. lanli@nrcan.gc. is offline
Registered User
 
Join Date: Aug 2003
Location: Ontario
Posts: 8
Question How to return a result from a procedure?

I created a procedure to select data. It works fine on SQLPlus. but I can't get any result from front-end which implemented in Coldfusion.
Does any one have an idea how to return a set values from a procedure?
Your reply is appreciate.
Reply With Quote
  #2 (permalink)  
Old 08-11-03, 17:03
RahulatDC RahulatDC is offline
Registered User
 
Join Date: Aug 2003
Posts: 1
You can do something like this...

CREATE OR REPLACE PROCEDURE ProcA
(a_dMonth IN DATE,
a_nStatus OUT NUMBER
)
AS

Now call the procedure in a sql script...

declare
nStatus Number :=0;
e_exception EXCEPTION;
begin
ProcA(to_date(&&1,'yyyymmdd',nStatus);
if nStatus > 0 then
dbms_output.put_line('yr message '||nStatus);
raise e_exception;
end if;
EXCEPTION
when e_exception then
null;
end;
/
Reply With Quote
  #3 (permalink)  
Old 08-11-03, 21:34
lanli@nrcan.gc. lanli@nrcan.gc. is offline
Registered User
 
Join Date: Aug 2003
Location: Ontario
Posts: 8
Talking

Thanks, I got it.
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