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

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

From: John Lin <johnlin_at_chttl.com.tw>
Date: 18 Aug 2004 21:52:15 -0700
Message-ID: <a73bcad1.0408182052.1a2e3f6f@posting.google.com>


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.*). Received on Wed Aug 18 2004 - 23:52:15 CDT

Original text of this message

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