dbTalk Databases Forums  

REF CURSOR

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss REF CURSOR in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
amerar@iwc.net
 
Posts: n/a

Default REF CURSOR - 03-27-2009 , 08:58 AM







Ok, this is probably a dumb question, but, I have this code:

CREATE OR REPLACE PROCEDURE cj_trials_log (
p_newsletter_id NUMBER,
p_conversion_date VARCHAR2,
p_data OUT REF_CRS) IS

TYPE ref_crs IS REF CURSOR;
..
..
..


I think it is upset because I use the REF_CRS before it is defined.
But how can you do this in a procedure? Since the parameter
declaration comes first? Do you create a public type? I'm not sure
how to do that......

Reply With Quote
  #2  
Old   
ddf
 
Posts: n/a

Default Re: REF CURSOR - 03-27-2009 , 12:50 PM






Comments embedded.

On Mar 27, 9:58*am, "ame... (AT) iwc (DOT) net" <ame... (AT) iwc (DOT) net> wrote:
Quote:
Ok, this is probably a dumb question, but, I have this code:

CREATE OR REPLACE PROCEDURE cj_trials_log (
* p_newsletter_id * * *NUMBER,
* p_conversion_date * *VARCHAR2,
* p_data * * * * * * * OUT REF_CRS) IS

TYPE ref_crs IS REF CURSOR;
.
.
.

I think it is upset because I use the REF_CRS before it is defined.
I'm doing my best to be civil ... and, yes, it IS 'upset' because of
your coding practices.

Quote:
But how can you do this in a procedure? *
You don't outside of a package.

Quote:
Since the parameter
declaration comes first?
This is one reason there are packages, as well as procedures. Declare
this in the package, then use it in the packaged procedire, it's
fairly simple.

Quote:
*Do you create a public type? *I'm not sure
how to do that......
You also can't search the newsgroup for "ref cursor" and see what you
find? Is it THAT difficult to use a search engine???

http://lmgtfy.com/?q=ref+cursor


David Fitzjarrell


Reply With Quote
  #3  
Old   
John Schaeffer
 
Posts: n/a

Default Re: REF CURSOR - 03-27-2009 , 02:36 PM



On Mar 27, 1:50*pm, ddf <orat... (AT) msn (DOT) com> wrote:
Quote:
Comments embedded.

On Mar 27, 9:58*am, "ame... (AT) iwc (DOT) net" <ame... (AT) iwc (DOT) net> wrote:

Ok, this is probably a dumb question, but, I have this code:

CREATE OR REPLACE PROCEDURE cj_trials_log (
* p_newsletter_id * * *NUMBER,
* p_conversion_date * *VARCHAR2,
* p_data * * * * * * * OUT REF_CRS) IS

TYPE ref_crs IS REF CURSOR;
.
.
.

I think it is upset because I use the REF_CRS before it is defined.

I'm doing my best to be civil ... and, yes, it IS 'upset' because of
your coding practices.

But how can you do this in a procedure? *

You don't outside of a package.

Since the parameter
declaration comes first?

This is one reason there are packages, as well as procedures. *Declare
this in the package, then use it in the packaged procedire, it's
fairly simple.

*Do you create a public type? *I'm not sure
how to do that......

You also can't search the newsgroup for "ref cursor" and see what you
find? *Is it THAT difficult to use a search engine???

http://lmgtfy.com/?q=ref+cursor

David Fitzjarrell
Dave,

I did search, but I was looking specifically to declare a REF within a
procedure......

Thanks!


Reply With Quote
  #4  
Old   
John Schaeffer
 
Posts: n/a

Default Re: REF CURSOR - 03-27-2009 , 02:41 PM



On Mar 27, 1:50*pm, ddf <orat... (AT) msn (DOT) com> wrote:
Quote:
Comments embedded.

On Mar 27, 9:58*am, "ame... (AT) iwc (DOT) net" <ame... (AT) iwc (DOT) net> wrote:

Ok, this is probably a dumb question, but, I have this code:

CREATE OR REPLACE PROCEDURE cj_trials_log (
* p_newsletter_id * * *NUMBER,
* p_conversion_date * *VARCHAR2,
* p_data * * * * * * * OUT REF_CRS) IS

TYPE ref_crs IS REF CURSOR;
.
.
.

I think it is upset because I use the REF_CRS before it is defined.

I'm doing my best to be civil ... and, yes, it IS 'upset' because of
your coding practices.

But how can you do this in a procedure? *

You don't outside of a package.

Since the parameter
declaration comes first?

This is one reason there are packages, as well as procedures. *Declare
this in the package, then use it in the packaged procedire, it's
fairly simple.

*Do you create a public type? *I'm not sure
how to do that......

You also can't search the newsgroup for "ref cursor" and see what you
find? *Is it THAT difficult to use a search engine???

http://lmgtfy.com/?q=ref+cursor

David Fitzjarrell

The other thing I was looking to do is to create some public REF
CURSOR type, and sort of include it anywhere I need it......

But if it must be a package, then it must....


Reply With Quote
  #5  
Old   
Shakespeare
 
Posts: n/a

Default Re: REF CURSOR - 03-27-2009 , 05:05 PM




Another example of identity crisis, Arthur? So now your name has become John
Schaeffer?

Shakespeare

(What's in a name?)



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

Default Re: REF CURSOR - 03-28-2009 , 07:30 AM



On Mar 27, 4:41*pm, John Schaeffer <ame... (AT) iwc (DOT) net> wrote:
Quote:
On Mar 27, 1:50*pm, ddf <orat... (AT) msn (DOT) com> wrote:





Comments embedded.

On Mar 27, 9:58*am, "ame... (AT) iwc (DOT) net" <ame... (AT) iwc (DOT) net> wrote:

Ok, this is probably a dumb question, but, I have this code:

CREATE OR REPLACE PROCEDURE cj_trials_log (
* p_newsletter_id * * *NUMBER,
* p_conversion_date * *VARCHAR2,
* p_data * * * * * * * OUT REF_CRS) IS

TYPE ref_crs IS REF CURSOR;
.
.
.

I think it is upset because I use the REF_CRS before it is defined.

I'm doing my best to be civil ... and, yes, it IS 'upset' because of
your coding practices.

But how can you do this in a procedure? *

You don't outside of a package.

Since the parameter
declaration comes first?

This is one reason there are packages, as well as procedures. *Declare
this in the package, then use it in the packaged procedire, it's
fairly simple.

*Do you create a public type? *I'm not sure
how to do that......

You also can't search the newsgroup for "ref cursor" and see what you
find? *Is it THAT difficult to use a search engine???

http://lmgtfy.com/?q=ref+cursor

David Fitzjarrell

The other thing I was looking to do is to create some public REF
CURSOR type, and sort of include it anywhere I need it......

But if it must be a package, then it must....- Hide quoted text -

- Show quoted text -
You can use a ref_cursor in a procedure without defining it first in a
package by using the Oracle provided pre-defined SYS_REFCURSOR
definition as in "FUNCTION f(p1 IN SYS_REFCURSOR) RETURN ... ; "

The quoted example is from the 9.2 PL/SQL manual section on
SYS_REFCURSOR. See the manual for more information.

HTH -- Mark D Powell --



Reply With Quote
  #7  
Old   
ddf
 
Posts: n/a

Default Re: REF CURSOR - 03-30-2009 , 09:04 AM



On Mar 28, 8:30*am, Mark D Powell <Mark.Pow... (AT) eds (DOT) com> wrote:
Quote:
On Mar 27, 4:41*pm, John Schaeffer <ame... (AT) iwc (DOT) net> wrote:





On Mar 27, 1:50*pm, ddf <orat... (AT) msn (DOT) com> wrote:

Comments embedded.

On Mar 27, 9:58*am, "ame... (AT) iwc (DOT) net" <ame... (AT) iwc (DOT) net> wrote:

Ok, this is probably a dumb question, but, I have this code:

CREATE OR REPLACE PROCEDURE cj_trials_log (
* p_newsletter_id * * *NUMBER,
* p_conversion_date * *VARCHAR2,
* p_data * * * * * * * OUT REF_CRS) IS

TYPE ref_crs IS REF CURSOR;
.
.
.

I think it is upset because I use the REF_CRS before it is defined.

I'm doing my best to be civil ... and, yes, it IS 'upset' because of
your coding practices.

But how can you do this in a procedure? *

You don't outside of a package.

Since the parameter
declaration comes first?

This is one reason there are packages, as well as procedures. *Declare
this in the package, then use it in the packaged procedire, it's
fairly simple.

*Do you create a public type? *I'm not sure
how to do that......

You also can't search the newsgroup for "ref cursor" and see what you
find? *Is it THAT difficult to use a search engine???

http://lmgtfy.com/?q=ref+cursor

David Fitzjarrell

The other thing I was looking to do is to create some public REF
CURSOR type, and sort of include it anywhere I need it......

But if it must be a package, then it must....- Hide quoted text -

- Show quoted text -

You can use a ref_cursor in a procedure without defining it first in a
package by using the Oracle provided pre-defined SYS_REFCURSOR
definition as in "FUNCTION f(p1 IN SYS_REFCURSOR) RETURN ... ; "

The quoted example is from the 9.2 PL/SQL manual section on
SYS_REFCURSOR. *See the manual for more information.

HTH -- Mark D Powell --- Hide quoted text -

- Show quoted text -
Thank you, I forgot about SYS_REFCURSOR.


David Fitzjarrell


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.