dbTalk Databases Forums  

Oracle Noob need help with function

comp.databases.oracle comp.databases.oracle


Discuss Oracle Noob need help with function in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
spawncamper
 
Posts: n/a

Default Oracle Noob need help with function - 07-27-2004 , 02:57 PM






Hi -

I posted here a few weeks back and people were kind enough to help.
In lieu of my PL/SQL class I take in a few weeks, I was hoping to get
some more advice.

Here's my scenario: I need a function to return a table of data for
Oracle8i.
I'm fairly certain of the stucture for the function, but am hazy on
the details.

CREATE OR REPLACE FUNCTION test_function (id in varchar2)

return table ****i know this isn't correct

IS

TYPE ref0 IS REF CURSOR;
cur0 ref0;

BEGIN

OPEN cur0 FOR
select id, name from user where id = id;

*****PERFORM SOME SORT OF LOOP AND ASSIGN TO VARIABLES - AM HAZY
HERE****

return table;
end;

Any assistance is greatly appreciated. Thank you for your time.

Reply With Quote
  #2  
Old   
Mark D Powell
 
Posts: n/a

Default Re: Oracle Noob need help with function - 07-28-2004 , 08:30 AM






jerel (AT) rockbaby (DOT) com (spawncamper) wrote in message news:<f2f4fe50.0407271157.189f42ff (AT) posting (DOT) google.com>...
Quote:
Hi -

I posted here a few weeks back and people were kind enough to help.
In lieu of my PL/SQL class I take in a few weeks, I was hoping to get
some more advice.

Here's my scenario: I need a function to return a table of data for
Oracle8i.
I'm fairly certain of the stucture for the function, but am hazy on
the details.

CREATE OR REPLACE FUNCTION test_function (id in varchar2)

return table ****i know this isn't correct

IS

TYPE ref0 IS REF CURSOR;
cur0 ref0;

BEGIN

OPEN cur0 FOR
select id, name from user where id = id;

*****PERFORM SOME SORT OF LOOP AND ASSIGN TO VARIABLES - AM HAZY
HERE****

return table;
end;

Any assistance is greatly appreciated. Thank you for your time.
Look in the PL/SQL manual. It is available free online via several
sites including technet.oracle.com (PDF downloads) and
tahiti.oracle.com which provides online search capability.

HTH -- Mark D Powell --


Reply With Quote
  #3  
Old   
cs
 
Posts: n/a

Default Re: Oracle Noob need help with function - 08-11-2004 , 07:24 PM



Hi

you can use pipelined functions

check for pipelined functions on asktom.oracle.com

hope this is helps

ss

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.