How to create a REF CURSOR from the static values?

We call for a program of power supply (from PL/SQL) that returns a string with data (separated by {}), lines like this:
{packetId:236,packetName:ADSL-320K-1M-3G},
{packetId:257,packetName:ADSL-1024K-1M-20G},
{packetId:232,packetName:ADSL-INTERANET-UNLIMITED},
{packetId:234,packetName:ADSL-512K-3M-16G},
..................
.........
.....
Our PL/SQL procedure should exit a REF CURSOR with lines like this:
236,  ADSL-320K-1M-3G
257,  ADSL-1024K-1M-20G
232,  ADSL-INTERANET-UNLIMITED
234,  ADSL-512K-3M-16G
.........
......
How do this pls?

Published by: Channa on May 18, 2012 02:30

Hello

Channa wrote:
It's the first gives ORA-00942: table or view does not exist for the FROM t . When I can replace the t split_t , I get ORA-32031: illegal reference to a query with the term name.

What is at stake here pls?

Use the name of your real of the table where I used t.
If you don't have a table, just a string, then select the double.

Tags: Database

Similar Questions

  • How to create a PDF file from the Clipboard in Adobe Acrobat Reader ms?

    Is it possible to create a PDF file from the Clipboard in Adobe Acrobat Reader ms?

    No, Acrobat Reader cannot create PDF files.

  • I have a column with two values, separated by a space, in each line. How to create 2 new columns with the first value in a column, and the second value in another column?

    I have a column with two values, separated by a space, in each line. How do I create 2 new columns with the first value in one column and the second value in another column?

    Add two new columns after than the original with space separated values column.

    Select cell B1 and type (or copy and paste it here) the formula:

    = IF (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    shortcut for this is:

    B1 = if (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    C1 = if (Len (a1) > 0, Member SUBSTITUTE (A1, B1 & "", ""), "")

    or

    the formula of the C1 could also be:

    = IF (Len (a1) > 0, RIGHT (A1, LEN (A1) −FIND ("", A1)), "")

    Select cells B1 and C1, copy

    Select cells B1 at the end of the C column, paste

  • How to create a Ref cursor table

    I have a proc that returns a Ref Cursor, what is the easiest way to create a table based on the return of the ref cursor?

    declare
    type rc is ref cursor;
    p_data rc;
    Start
    call_my_proc (p_data);
    : result: = p_data; ((- If I run this in TOAD I can see the data here, but I want to create a table based on it rather than showing)
    end;


    Thank you.


    Edit: sorry. typed this wrong, first time, should be right now

    I recommend you read this first... {: identifier of the thread = 886365}

    and then you'll have a better idea of how to make to create a table in your query.

  • How to pass a REF CURSOR from a function

    I tried to compile the following function:

    CREATE or REPLACE FUNCTION example
    RETURN REFCURSOR
    IS
    heart REFCURSOR;
    BEGIN
    OPEN FOR heart
    "SELECT x FROM table";
    RETURN cur;.
    END;

    but I get:

    PLS-00201: identifier 'REFCURSOR' must be declared.

    Can you help me in the right syntax? I never return a REF CURSOR to a function.
    Is my Version of Oracle 8.1.7

    Thank you!

    You cannot use SYS_REFCURSOR in Oracle 8i.
    The work is approximately as follows

    create or replace package my_pk as
    type my_cur is REF CURSOR;
    end my_pk;
    
    -- Now write your function
    create or replace function my_func return my_pk.my_cur
    as
    l_cur my_pk.my_cur;
    begin
    open l_cur for select * from table_name;
    return l_cur;
    end my_func;
    

    Thank you
    Andy

  • How to create a new record with the old values

    Hi all

    I have the creation with 45 page are there fields
    the user will enter all areas and save, it will call the uneditable mode

    If the change button is clicked it will call for the editable mode

    My requirement is user will not change among these ites (45 items) clcik on save again it will call to view mode

    in this user will change one value among 45 Articles and click on the button Save I need to create more than one record in the database

    If the user will not modify one of the field elements of the 45 I will not create a new record in the database

    How can we achieve this feature


    Concerning
    Anthony

    Hi Mary,

    Please try this method to copy a line in the new line...

    public void copy()
    {
    Pervert SuppliersVOImpl = getSuppliersVO1();
    Rank rank [] = pervo.getFilteredRows ("SelectFlag", "Y");
    for (int i = 0; i)<>
    {
    Rowi rank (SuppliersVORowImpl)= SuppliersVORowImpl;
    OADBTransaction trx (OADBTransaction) = getTransaction ();
    Number b = trx.getSequenceValue ("FWK_TBX_SUPPLIERS_S");
    AttributeList a rowi = (AttributeList);
    R = (SuppliersVORowImpl) pervo.createAndInitRow SuppliersVORowImpl (a);
    Define your unique attribute values here, I'll put here Ref supplier as with each new line, it must be different.
    r.setSupplierId (b);
    pervo.insertRow (r);
    }
    }

    Kind regards
    Out Sharma

  • How to create a report based on the item selected from the list of selection?

    Hello

    I created a tables_LOV based on:

    Select table_name table_name user_tab_cols r, d

    where column_name like '% _type % '.

    Then I created a ListOfTables page element, display in a selection list and pointing to tables_LOV.

    I run the page, and I can choose the table I want in the drop-down list.

    How to create a report based on the selected element? (ex: select * from selected_table)

    Thanks in advance

    Salah

    Hi Salah,

    Allright, take a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report

    I think that simulates what you are trying to accomplish. I've implemented the simplest method I could think of.

    The report is based on a collection of apex. If you are not familiar with this, you should study the documentation: APEX_COLLECTION

    To recreate my example, you should:

    (1) create a report (interactive) on your collection

    SELECT *
       FROM APEX_collections
     WHERE collection_name = 'MY_COLLECTION'
    

    (2) create a selection list page_item for the tables that you want to display (in my case, this is called "P38_TABLES")

    (3) create a dynamic action that triggers on the evolution of your selection list page_item. Dynamic action must be a parade of PL/SQL procedure the following code:

    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
    
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
        );
    end;
    

    Make sure that you add your page_item 'Page to send items' section.

    (4) add a real extra action that makes an update of the report area.

    Here are two photos describing the da:

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA1.PNG

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA2.PNG

    Good luck and greetings,

    Vincent

    http://vincentdeelen.blogspot.com

  • How to create a shortcut to toggle the sound device?

    Anyone have any suggestions on how to create a shortcut to toggle the USB audio device in Device Manager?

    A shortcut is to enable this device, and the other shortcut is disable this device.

    Thanks for all the suggestions

    Hi oem7110,

    · Why you want to create a shortcut to enable or disable an audio device from Device Manager?

    You will be able to create the shortcut to Device Manager but no shortcut to enable/disable a device in Device Manager:

    a. right-click on the space empty where you want to create a shortcut

    b. click the shortcut

    c. in the type of space empty in devmgmt.msc

    d. click Next and follow the instructions in the wizard.

    With regard to:

    Samhrutha G S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How can I transfer a file from the operating system to a backup of the production running VM virtual machine?

    Problem:  After I do a backup one using ghettoVCB on a local VMFS volume, I have a virtual machine that I can start something happened to that running.  However, sometimes I just need a file from the OS level, which means that I would need to start to get them, but then I have an IP address conflict.  I can't imagine a way to have the NICs turned off and still be able to move the file.  If I change the IP addresses, the software that I need to create the file that I need to transfer no longer works because, although there no need of constant connectivity to the seller, it is locked to the public IP address.http://communities.vmware.com/images/emoticons/sad.gif

    Material:  I have two 4 ESXi hosts to work, each with local VMFS volumes.  They share a private vlan common and a vlan common public.  They each ssh, ftp, wput, wget, and rsync available.  I have a Windows 2003 Server VM which also hosts a NFS and the VI client and other VMWare tools.  It also has private and public interfaces as do virtual machines that would be to make and receive the OS files.

    Question:  How can I transfer a file from the operating system to a backup of the production running VM virtual machine?

    Thank you!

    Yes Mr President, make sure you set the network on this virtual machine to be connected to the 'Internal' vswitch, you set up before turning the power on to the virtual machine.

    -

  • What is the difference between the ref cursor and the sys_refcursor.

    create or replace procedure GetEmployeesInDept (c sys_refcursor)

    Hello


    I have a query related to the above stored procedures.
    When you set the cursor, we mentioned as sys_refcursor and in some US sites I saw him as a REF CURSOR as shown

    create or replace procedure GetEmployeesInDept (Ref Cursor c)


    Please tell me what is the difference between the ref cursor and the sys_refcursor.

    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/tuning.htm#sthref2376

    Concerning

    Etbin

  • How can I remove an application from the App Store in the section update application?

    How can I remove an application from the App Store in the section update application?

    You can not delete Apps from the update tab. It's just a list

    The list is just for information purposes. Finally, they are deleted from the list on their own.

  • How to open a new tab from the address line?

    How to open a new tab from the address line?

    You will need to hold down the ALT key and press ENTER to open the link in a new tab without the use of an extension cord.
    By default the links always open in the same tab.

    You can search the Addons site for an extension if you want to change this default behavior.

  • The windows of the bar of Windows are already a form of tabs, so I need them in Firefox. How can I turn off completely from the 23 of Firefox?

    RE: TABS ARE WINDOWS!
    The windows bar already functions as a tab bar. These tabs are called "windows". So, I find windows superfluous Firefox tab. How can I turn off completely from the 23 of Firefox? I don't need to what are essentially the bars of TWO Windows covering the entire width of the image of my screen! I already have a Windows bar at the bottom of my screen, and if I really wanted to, I could change ITS position towards the top of the screen, so that it would LOOK at the windows of Firefox tabs bar. Firefox TABS are, essentially, a SECOND bar Windows superfluous.

    Here are my reasons why I prefer to use Mozilla's Firefox, Microsoft Internet Explorer or Google Chrome. I love and admire Firefox intended to Mozilla on good security for Personas Firefox Add-on and for free use of Firefox in the Add on Ad-Block, which, as you know, has the merit of separate to reduce the size of the screen - the last is my reason for wanting to get rid of "windows" Firefox SUPERFLUOUS tabs bar. I'm terribly sick companies forcing bars (most representative of marketing campaigns, trying to sell me something) in my browser (and in my throat) whenever I download something. (In case you haven't guessed, I have deliberately talking about your bar of Firefox tabs as a '' windows' tabs Firefox bar', because the TABS are WINDOWS!)

    You can also have an addon to open new tabs in a new window.

  • How can I delete a message from the community of apple support

    How can I delete a message from the community of apple support

    You can not

    Why do you want?

  • How can I remove my name from the top right of the screen. I have a 2015 13 "MacBook Pro running 10.11.4

    How can I remove my name from the top right of the screen. I have a 2015 13 "MacBook Pro running 10.11.4

    At the top right of the menu bar shows the current user who is logged in and allows quick change of user accounts.

    You can disable the display of menu bar in system preferences > users and groups. Or order just drag it out of the bar.

Maybe you are looking for