Create or Replace Function(...) RETURN Record AS

Posted on 2006-05-06
Last Modified: 2008-02-01
I need to write an Oracle Function that will return 2 values.  
I thought I could use a record type for the return, but don't know how to code it.  


create or replace function thisFunction(input parameters ... ) RETURN Record
t_rec TYPE Record
amount number,
descirption varchar2(100)
r_rec t_rec;
... code
RETURN r_rec;
END thisFunction;

Can an expert provide the skeletal structure for such a function that will return a TYPE record?
Question by:dvpiper
    1 Comment
    LVL 1

    Accepted Solution


    I would recomend to use procedure with OUT parameters instead of a FUNCTION. It is much more easier and acess would be no problem if you can acess functions.

    Code will be something like...

    create or replace PROCEDURE thisProcedure (
       amount        IN OUT NUMBER,
       description   IN OUT VARCHAR2 )
       ... your local variable declarations here
      ... your code here...
      amount := <value>;
      description   := <value>;
    END thisProcedure;  

    Hope this helps.

    - Sandaruwan -

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious sideā€¦
    From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
    Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now