Home » SQL & PL/SQL » SQL & PL/SQL » PL SQL Doubts
PL SQL Doubts [message #246554] Thu, 21 June 2007 05:25 Go to next message
rajesh_bhadu
Messages: 48
Registered: June 2007
Member
Hi all,

I am new to PL SQL.
I have some doubts as following

1. How to create a function in such a way that it'll return all the records of table. Table name will be passed as a parameter to that function. So I m confused what is return type of that function

2. Can i call a function from a procedure.

3. Can i user TRIM function of string on variables that have been passed in function or procedure as parameters.


Please provide your valuable suggestions.

Thanks

rajesh
Re: PL SQL Doubts [message #246559 is a reply to message #246554] Thu, 21 June 2007 05:31 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1. returns a REF CURSOR
2. Yes
3. Yes if they are declared as IN OUT parameter. Otherwise you can copy the parameter into local variable and trim it.

Regards
Michel
Re: PL SQL Doubts [message #246560 is a reply to message #246559] Thu, 21 June 2007 05:34 Go to previous messageGo to next message
rajesh_bhadu
Messages: 48
Registered: June 2007
Member
Thanks for your help.

One more thing regarding first doubt.When this cursor will be closed.

Thanks in advance.
Re: PL SQL Doubts [message #246561 is a reply to message #246560] Thu, 21 June 2007 05:41 Go to previous messageGo to next message
iamdurai
Messages: 96
Registered: April 2007
Location: Chennai
Member

Hi click this link For your referance REF Cursor

Reds
Thangam.
Re: PL SQL Doubts [message #246563 is a reply to message #246560] Thu, 21 June 2007 05:42 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The caller closes the cursor when it no more needs it.

Regards
Michel
Re: PL SQL Doubts [message #246569 is a reply to message #246563] Thu, 21 June 2007 06:05 Go to previous message
rajesh_bhadu
Messages: 48
Registered: June 2007
Member
Really this information is very useful.
I am very thankful all of you.
Previous Topic: Rows to column conversion, based on date column
Next Topic: whats the difference b/w procedure and transaction in oracle?
Goto Forum:
  


Current Time: Wed Dec 07 03:23:37 CST 2016

Total time taken to generate the page: 0.15369 seconds