Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Create a view using OUT values from a procedure - how?

Re: Create a view using OUT values from a procedure - how?

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sat, 09 Oct 2004 12:34:25 -0700
Message-ID: <1097350550.407177@yasure>


Mike wrote:

> On Thu, 07 Oct 2004 18:29:15 -0700, Daniel Morgan
> <damorgan_at_x.washington.edu> wrote:
> 
> 

>>Mike wrote:
>>
>>
>>>Hi, I¡¦m creating a view and would like to have two of the columns to
>>>contain data obtained from a procedure which has two out values. I'm using
>>>Oracle 9.2
>>>
>>>For example
>>>
>>>Create view student.v_grades
>>>(str_student, studentID, str_higrade, str_lowgrade)
>>>AS
>>>Select studentdb.student,
>>> Studentdb.studentID,
>>>/* How do I get student grades from the procedure */
>>>FROM studentdb
>>>WHERE ( ¡K)
>>>
>>>
>>>e.g. procedure:
>>>
>>>Create Procedure PR_getgrades(
>>>P_higrade OUT VARCHAR2,
>>>P_lowgrade OUT VARCHAR2
>>>P_studentID IN Number)
>>>IS
>>>BEGIN
>>>
>>>/*process data*/
>>>
>>>P_higrade := result1;
>>>P_lowgrade :=result2;
>>>
>>>End;
>>>END PR_getgrades;
>>>/
>>>
>>>Thanks,
>>>
>>>Mike
>>
>>It can not be done.
>>
>>Hasn't your instructor taught you anything about how Oracle works?
>>
>>There are solutions ... but as this is clearly classwork you need
>>to figure them out for yourself. So what you get is a hint.
>>
>>Hint: Use functions.
> 
> 
> 
> Hi, I am not a student, although I am a noob to Oracle PL/SQL. Using
> functions does not solve my problem, because a function can only
> return one value, and I need two values. I could create two functions
> and do double the processing, but this seems inefficient, but
> according to this group this is the only way. True?
> 
> Thanks,
> 
> Mike

You have two choices:

  1. Create two functions.
  2. Figure out another way to do it without stored code.

I'd choose the later.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Sat Oct 09 2004 - 14:34:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US