Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: getting oracle function to return record type
On Tue, 08 Dec 1998 09:40:46 -0600, Kent Eilers
<kent.eilers_at_pca.state.mn.us> wrote:
>Can anyone help me figure out what is the syntax to return a record type
>from a function?
>
>thanks.
>=====================================================
>CREATE OR REPLACE FUNCTION KE_GET_WASTE_ACTIVITY_CODE
>(
>as_id varchar2
>)
>RETURN type ?????
>.....
>=====================================================
>
Do you mean a user defined record type like...
SQL> create or replace package myPackage as
2
3 type myRec is record(
4 f1 number, 5 f2 varchar2(200) );
Package created.
Or do you want to return a record that is a row of a table?
SQL> desc foo Name Null? Type ------------------------------- -------- ---- A NUMBER B NUMBER D DATE C NUMBER
SQL> create or replace package myPackage as
2 function myFunct return foo%rowtype;
3 end myPackage;
4 /
Package created.
hope this helps.
chris.
--
Christopher Beck
Oracle Corporation
clbeck_at_us.oracle.com
Reston, VA.
![]() |
![]() |