• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2145
  • Last Modified:

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

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.  

Essentially:

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

Can an expert provide the skeletal structure for such a function that will return a TYPE record?
0
dvpiper
Asked:
dvpiper
1 Solution
 
sandaruwanCommented:
Hi,

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 )
IS
   ... your local variable declarations here
BEGIN
  ... your code here...
  amount := <value>;
  description   := <value>;
END thisProcedure;  

Hope this helps.

- Sandaruwan -
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now