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: How to use a row * AS a ROWTYPE parameter for a stored FUNCTION in a SELECT statement

Re: How to use a row * AS a ROWTYPE parameter for a stored FUNCTION in a SELECT statement

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Thu, 19 Aug 2004 06:23:35 -0700
Message-ID: <1092921863.446829@yasure>


John Lin wrote:

> Dear all,
>
> Suppose I have a FUNCTION as below:
>
> CREATE OR REPLACE FUNCTION test (x myTable%ROWTYPE) RETURN INTEGER
> AS BEGIN RETURN 1; END;
>
> How can I pass a whole row to it in a SELECT statement? For example:
>
> SELECT test(*) FROM myTable; -- doesn't work
>
> SELECT test(t.*) FROM myTable t; -- doesn't work
>
> What is the correct way to achieve this?
> Thank you very much.
>
> John Lin
>
> P.S. For the following statement:
>
> SELECT t.*, SYSDATE, t.* FROM myTable t;
>
> it works to treat * as a whole row. Don't know why it won't for test(t.*).

Pass an array ... not a row.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Thu Aug 19 2004 - 08:23:35 CDT

Original text of this message

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