What's the problem for this package????

My Package is :
CREATE OR REPLACE PACKAGE MY_PAQ IS
TYPE RESULT IS REF CURSOR;
FUNCTION MY_FUN
RETURN RESULT;
END MY_PAQ;
CREATE OR REPLACE PACKAGE BODY MY_PAQ IS
FUNCTION MY_FUN
RETURN RESULT
IS
C RESULT;
BEGIN
OPEN C FOR SELECT * FROM MY_TAB;
RETURN C;
END MY_FUN;
END MY_PAQ;
SQL> SELECT MY_PAQ.MY_FUN FROM DUAL;
SELECT MY_PAQ.MY_FUN FROM DUAL
ERROR at line 1:
ORA-00902: invalid datatype
I like that my function returns a set of rows from a table(s)
thanks in advance
Mario

Mario,
Package seems okay. However since the function returns an open cursor, one suggested option is as follows:
sqlplus > variable test_cursor refcursor;
use this bind variable and call the function
sqlplus > exec :test_cursor := MY_PAQ.MY_FUN;
sqlplus > print test_cursor;
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Mario Alberto Suarez ([email protected]):
My Package is :
CREATE OR REPLACE PACKAGE MY_PAQ IS
TYPE RESULT IS REF CURSOR;
FUNCTION MY_FUN
RETURN RESULT;
END MY_PAQ;
CREATE OR REPLACE PACKAGE BODY MY_PAQ IS
FUNCTION MY_FUN
RETURN RESULT
IS
C RESULT;
BEGIN
OPEN C FOR SELECT * FROM MY_TAB;
RETURN C;
END MY_FUN;
END MY_PAQ;
SQL> SELECT MY_PAQ.MY_FUN FROM DUAL;
SELECT MY_PAQ.MY_FUN FROM DUAL
ERROR at line 1:
ORA-00902: invalid datatype
I like that my function returns a set of rows from a table(s)
thanks in advance
Mario<HR></BLOCKQUOTE>
null

Similar Messages

  • Adobe X PDF files converted to jpg, edited and converted back to PDF have ragged, unclear text.  I didn't have this problem with Acrobat 9 standard.  What is the remedy for this.  If this is the best I can expect, I won't be able to use X standard.

    Adobe X PDF files converted to jpg, edited and converted back to PDF have ragged, unclear text.  I didn't have this problem with Acrobat 9 standard.  What is the remedy for this.  If this is the best I can expect, I won't be able to use X standard.

    I can't imagine any worse workflow than converting to JPEG to edit text, then back to PDF. Text in a PDF is a vector thing, smooth at all resolutions. And JPEG is made for photos. EVERY conversion to JPEG and back loses quality but how much loss there is will vary.
    If you must go to an image format, try PNG.

  • Deactivation of Photoshop CS3 leads to an error 1914:1 what ist the solution for this problem

    hello
    I try to deactivate photoshop CS3 on my win XP system. When I try this I get the error code 1914:1 . This says there are no activations. But when I try to activate it on the new WIN 7 system
    I get the message to many activations. What is the soltion for this problem?

    Contact support by web chat.
    Mylenium

  • I have my Adobe ID and the Adobe Digital Editions. But when I download an EPUB-ebook, I don´t see the ebook or "My Digital Editions-Bibliothek".What is the solution for this problem?

    @I have my Adobe ID and the Adobe Digital Editions. But when I download an EPUB-ebook, I don´t see the ebook or "My Digital Editions-Bibliothek".What is the solution for this problem?

    how can we solve the problem?
    I have my adob.e ID, downloaded Adobe Digital Editions.
    Whren I download EPUB-ebooks and want to use
    Digital Editions, nothing happens and appears!??
    Please give me a short feedback and help

  • Hi. my laptop was reformatted recently, and my itunes there erased. i created a new one but the problem is it doesn't sync with my ipod anymore. what is the solution for this? can someone give me a tip? will really appreciate. thanks

    hi. my laptop was reformatted recently, and my itunes there erased. i created a new one but the problem is it doesn't sync with my ipod anymore. what is the solution for this? can someone give me a tip? will really appreciate. thanks

    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

  • Vector, what is the problem with this code?

    Vector, what is the problem with this code?
    63  private java.util.Vector data=new Vector();
    64  Vector aaaaa=new Vector();
    65   data.addElement(aaaaa);
    74  aaaaa.addElement(new String("Mary"));on compiling this code, the error is
    TableDemo.java:65: <identifier> expected
                    data.addElement(aaaaa);
                                   ^
    TableDemo.java:74: <identifier> expected
                    aaaaa.addElement(new String("Mary"));
                                    ^
    TableDemo.java:65: package data does not exist
                    data.addElement(aaaaa);
                        ^
    TableDemo.java:74: package aaaaa does not exist
                    aaaaa.addElement(new String("Mary"));Friends i really got fed up with this code for more than half an hour.could anybody spot the problem?

    I can see many:
    1. i assume your code snip is inside a method. a local variable can not be declare private.
    2. if you didn't import java.util.* on top then you need to prefix package on All occurance of Vector.
    3. String in java are constant and has literal syntax. "Mary" is sufficient in most of the time, unless you purposly want to call new String("Mary") on purpose. Read java.lang.String javadoc.
    Here is a sample that would compile...:
    public class QuickMain {
         public static void main(String[] args) {
              java.util.Vector data=new java.util.Vector();
              java.util.Vector aaaaa=new java.util.Vector();
              data.addElement(aaaaa);
              aaaaa.addElement(new String("Mary"));
    }

  • I have a fairly new mac book pro with retina display- I have not tried installing anything other OS on it. In spite of that yesterday when I turned it on, I got the error: no bootable device insert boot disk and press any key. what is the reason for this?

    I swithced it on by clicking on options when I start up and then clicked on Macintosh HD. the other option was a question mark and network drive.
    Is there a way to ensure it never happens again, what is the cause for this problem, if I need to uninstall some application, i am happy to do it as long as I know what is causing this conflict.
    many thanks!

    Something is not making sense here.
    You claim this is a brand new machine and you have not tried to install Windows or Boot Camp.
    Then why would you ever even go into System Preferences > Startup Disk and choose Macintosh HD? It should have automatically booted into Macintosh HD.
    You're probably going to have to reinstall Mac OS X.

  • What's the problem in this code

    import java.lang.reflect.*;
    import java.awt.*;
    class ABC
         public Integer i;
         ABC()
         public void setInt(Integer t)
              i = t;
    public class SampleName {
    public static void main(String[] args)
    ABC g1 = new ABC();
    g1.setInt(new Integer(10));
    printFieldNames(g1);
    static void printFieldNames(Object o) {
    Class c = o.getClass();
    Field[] publicFields = c.getDeclaredFields();
    for (int i = 0; i < publicFields.length; i++)
    try {
    Object ref = publicFields.get(c);
    System.out.println(" ref.toString() : " + ref.toString());
         }catch(Exception e)
                   e.printStackTrace();
    What is the problem with this code,at run time Iam getting this exception
    java.lang.IllegalArgumentException: object is not an instance of declaring class
    How can we get the value of field of an object

    Now it got this exception
    java.lang.IllegalAccessException
    at java.lang.reflect.Field.get(Native Method)That's strange - I didn't! ;-)
    Are you running exactly the same code as the code you posted (except for the one line I said to change)?

  • ANY BODY TELL ME WHAT IS THE REASON FOR THIS ERROR

    hi... experts....
        Iam having one screen in my previous module pool program....and now as per my requirement i added on e new field...
    for that...
      1. i declared one variable in top include...
      2. cretaed one more new block with help of box in layout screen..
      3. added some text field and inputput out field...
      4. and in that block i also added one line with test like... following...
    " NOTE: PLEASE ENTER THE ..... VALUE..."   Like this.... just for to give direction...
    so these are  the steps i taken to add new field to my screen... but here i am geting error ... while entering the value in that field and press any push button.... including back in that screen... like....
      "INVAILD FIELD FORMAT (SCREEN ERROR)"
    .... ANY BODY TELL ME WHAT IS THE REASON FOR THIS ERROR... COMMONLY???
    THANK YOU,,,
    NAVEEN..

    hi naveen,
    there can be problem from ur layout side.
    Goto SE51. in Layout editor make sure that the type in screen and in TOP Include is same.
    and if you are using currency field than it can also give error to you.
    if still you any error .
    give me type of variable whcih you defined in TOP and also code.
    give reward if helpfull.

  • What's the error in this package

    dear all,
    can you plz tell me what's the erro in this package plz
    SQL> CREATE OR REPLACE PACKAGE discounts
      2  IS
      3  g_id NUMBER := 7839;
      4  discount_rate NUMBER := 0.00;
      5  PROCEDURE display_price (p_price NUMBER);
      6  END discounts;
      7  /
    Package created.
    SQL>
    SQL>
    SQL> CREATE OR REPLACE PACKAGE BODY discounts
      2  IS
      3  PROCEDURE display_price (p_price NUMBER)
      4  IS
      5  BEGIN
      6  DBMS_OUTPUT.PUT_LINE ( 'Discounted '
      7  ||TO_CHAR(p_price*NVL(discount_rate, 1)));
      8  END ;
      9  discount_rate:= 0.10;
    10  END ;
    11  /
    Warning: Package Body created with compilation errors.
    SQL>
    SQL> show errors;
    Errors for PACKAGE BODY DISCOUNTS:
    LINE/COL ERROR
    9/1      PLS-00103: Encountered the symbol "DISCOUNT_RATE" when expecting
             one of the following:
             begin end function package pragma procedure form
             The symbol "begin" was substituted for "DISCOUNT_RATE" to
             continue.
    SQL>

    if you want declare a private variable you need to declare at package body and remove from the package specification
    something like this
    @10g> CREATE OR REPLACE PACKAGE discounts
      2    IS
      3   g_id NUMBER := 7839;
      4    PROCEDURE display_price (p_price NUMBER);
      5    END discounts;
      6  /
    Package created.
    @10g> 
    @10g> CREATE OR REPLACE PACKAGE BODY discounts
      2    IS
      3    discount_rate NUMBER := 0.10; /* Private declaration */
      4  
      5    PROCEDURE display_price (p_price NUMBER)
      6    IS
      7    BEGIN
      8    DBMS_OUTPUT.PUT_LINE ( 'Discounted '
      9    ||TO_CHAR(p_price*NVL(discount_rate, 1)));
    10    END ;
    11  END ;
    12  /
    Package body created.You can't assign values to variables out of procedure unless you declare and assign a initial value.
    Edited by: dask99 on Oct 26, 2009 8:23 AM

  • When I try to install CS6 Design and Web Premium from a disk I get this message "We are unable to validate this serial number..." What is the reason for this?

    I purchased a disk copy of CS6 Design and Web Premium from a reputable seller last week and when I try to install it with the serial number I got it says "We are unable to validate this serial number for CS6 Design and Web Premium. Please contact Customer Support." What is the reason for this?
    Is the serial number invalid?

    Hi Ned,
    Thanks for the suggestion. I eventually got in touch with Adobe Technical Support and it turned out that my Adobe Application Manager was not the latest version. They downloaded the latest version and installed it and that seemed to solve the problem. I was able to install my CS6 Creative Suite and validate the serial number. All seems to be going well at the moment.

  • TA20920 Mac original is 10.6 and have upgrate to 10.6.8 and than i continue updating to 10.8 and this kind of message always appear until i turn off and turn it on. what is the solution for this message

    i got Mac originally version is 10.6 and have upgrate to 10.6.8 and than i continue updating to 10.8 and this kind of message always appear until i turn off and turn it on. what is the solution for this message

    This message?
    http://support.apple.com/kb/TA20920
    is a difficult one to resolve.
    There is an analysis and suggestions to this problem posted here.
    http://www.thexlab.com/faqs/kernelpanics.html

  • My Ipod touch is frozen.  Shows USB cable with arrow pointing to Itunes.  What is the problem?  This is the second one I have had that has done this!

    My Ipod touch is frozen.  The screen shows only USB cable with arrow point to the word Itunes.  What is the problem?  This is the second touch I have had that has this same problem.  HELP!

    This time try restoring the iPod to factory defaults/new iPod instead of from backup.  You may have some corruption that is causing the problem and it may now be in the backup.  If the problem persists after restoring to factory defaults/new iPod. then you likely have a hardware problem and ana ppointment at the Genius Bar of an Apple store is in order.

  • TS1702 I use iphone5, I see an app update on the app store. but when App store and click on the update tab, it doesn't show me which application to update.. just give me a blank page.!!!! what is the solution for this.!!!!

    I use iphone5, I see an app update on the app store. but when App store and click on the update tab, it doesn't show me which application to update.. just gives me a blank page.!!!! I wouldn't able to know what app has to be updated, untill and unless i get check for each every app on the app store installed on my iphone... what is the solution for this.!!!! can any1 one help me out.!!!!

    Cc2528 wrote:
    The iTunes Store on my iPad is set up with all my music already. And at the very bottom it shows my apple Id username. The only place it shows the previous owners id is in the App Store...
    You can probably change the ID in the "iTunes and App stores" settings on the iPad....click on the wrong account ID , select sign out, then log in with your own ID, I have not done this but I think it works.....
    but I would be more inclined to to the factory reset and start afresh.

  • I recently upgraded to Mac OS X.  I hadn't try to access anything in iWorks 09 since the upgrade, until now.  I get an error message when trying to open any of the iWorks 09 applications.  What's the fix for this?

    I recently upgraded to Mac OS X.  I haven't tried to access anything in iWorks 09 since the upgrade, until now.  I get an error message when trying to open any of the iWorks 09 applications.  What's the fix for this?

    Follow Sonicray's advice and when you post try to give as much info about your Mac, your OS, etc... Fill out your Profile info.

Maybe you are looking for

  • Opportunity.TEXT_31 Field in Answers

    Can anyone tell me why there are two "Opportunity ID" fields in Answers for all opportunity-related subject areas (including Opportunity Product Revenue subject-areas)? For example, in the "Opportunity Product Revenues reporting subject-area", has on

  • How do I change my itunes account from one computer to my new one?

    how do I change my itunes account from one computer to my new one?

  • How can reset/delet domain passwaord cache in local machine

    Dear concerns, I am using a windows 8 operating system, I am member of a domain. Also I am a local administrator of my laptop. I also have made image of my system drive. Yesterday my windows got stuck and its giving errors regarding  startup applicat

  • Urgent: OE_ORDER_PUB API Error

    Hi all, When I tried to create Sales orders using OE_ORDER_PUB api, it throws this error, FLEX-NULL SEGMENT Values have not been entered for one or more required segments. This is my piece of code I am using for order creation, vReturnStatus VARCHAR2

  • Variable file path

    In File curfile1, I am fixing my path and sending that path in ReadFile. But I do not want to fix my path, instead whatever path I select while using my user interface should be my curfile1. My code below with fixed path is working fine: private void