Iteration of generic cursor Ref

I wonder if it is possible to browse the columns of a row of slider ref in a generic way (that is, it would work on different rowtypes). Take, for example, the following pseudocode:
function create_csv_str(
    p_rows in sys_refcursor)
return varchar2
is
    v_data varchar2(1000);
begin
    while p_rows loop
        for each col in p_rows loop
            v_data := v_data||col||',';
        end loop;
        v_data := substr(v_data,1,length(v_data)-1)||CHR(10);
        p_rows := p_rows->next;
    end loop;
    return v_data;
end create_csv_str;
A slider Ref is just a pointer, I think that we could just iterate over the columns of all that points to the ref cursor, whether 2 columns or 200.

crottyan wrote:
So if I were to create a Ref Cursor, switch it to a subroutine and convert it into DBMS_SQL slider in the subroutine, I could achieve the desired effect?

Yes, in 11G you can convert a ref cursor cursor DBMS_SQL, then use DBMS_SQL. DESCRIBE_COLUMNS to find the number and data types, select the list of expressions and search.

SY.

Tags: Database

Similar Questions

  • Manipulation of data from a cursor ref in the block of data in a form

    I use Oracle Forms 10 g. I have a ref cursor that returns the columns A, B, C, D, E, B, C, D, E are where values. The attribute"query data Source name"in the datablock contains "CCTR_Extract_pkg.cctr_refcur". The attribute 'Column name' article A contains 'A', point B contains 'B', etc. All of these columns are displayed on the form, and everything works perfectly.

    I have a new request, users would like a 6th displayed column - F - where it is equal to D - B.

    Is it possible to do so in the form only, or do I have to change the ref cursor to accommodate the new column, and then the form?
    If it is possible in the form (only) - how to reference the 2 columns?

    Thank you in anticipation
    Michael

    Published by: user8897365 on August 24, 2011 10:32

    My understanding of the ref Cursor, if you change it and then all other objects that use it also require recompilation. I was trying to avoid this situation.

    Since your block of form data is based on the Ref Cursor, you cannot avoid this. You must change the Ref Cursor to add the required columns.

    I was hoping that there may be a way to reference the elements of ref cursor in a similar way (IE not change ref cursor).

    Depending on how the new columns are data in your Ref Cursor, you could add the columns as part of another base table and then use the trigger after query to retrieve the associated data. Unfortunately, this make the data in these new column cannot be changed. If you do not need the ability to update data, it is an option.

    Craig...

  • Difference of cursor (REF Cursor & Sys_Refcursor)

    Hello

    Is there a difference between REF Cursor and SYS_Refcursor?

    I see some packages using sys_refcursor and others using the REF Cursor.
    Package 1 (Spec):
       PROCEDURE s_demo1 (
          ret_rset   OUT      sys_refcursor
       );


    Package 2 (Spec):
    TYPE cur_set IS REF CURSOR;
    PROCEDURE s_test1 (out_data OUT cur_set);
    PROCEDURE s_test2 (out_data OUT cur_set);
    I'm going through this link (http://sql-plsql.blogspot.com/2007/05/oracle-plsql-ref-cursors.html) but did not find the answer.

    SYS_REFCURSOR is a REF CURSOR defined by oracle. Thus, you can not compare SYS_REFCURSOR and REF CURSOR.

    SYS_REFCURSOR is a week REF CURSOR, meaning it doesn't have a return type precise than what we will have in a refcursor defined by the user.

    And in your example, I see no difference between SYS_REFCURSOR and CUR_SET because only the two week REF CURSOR.

    Published by: Karthick_Arp on November 17, 2010 06:36

  • extract data from the generic cursor xy graph

    Hi, I'm new in this Forum.

    In my VI I need to extract the data from the graph xy of one cursor to another, how can I do this?

    I want to extract all the data between the two sliders, to develop.

    Thank you

    In addition to everything said altenbach, you want the slider list: property of the Index. That will tell you where in the table of data, the sliders are.

    The attached VI shows how we can work and also meaningless how it can be with common types of XY data.

    Lynn

  • Fetch cursor object type ref

    Hello! I have a Ref Cursor already opened by an external procedure. I need to fetch it in a table of objects like this
    CREATE OR REPLACE TYPE TAB_CUSTOM AS TABLE OF REC_CUSTOM;
    where
    CREATE OR REPLACE TYPE REC_CUSTOM AS OBJECT
    (
         my_id     NUMBER(6)
            .......
           ,CONSTRUCTOR FUNCTION REC_CUSTOM RETURN SELF AS RESULT
    )
    NOT FINAL;
    /
    a correct columns, types and size of the open cursor ref.

    How can this be accomplished?

    Something like:

    declare
        v_custom_tbl TAB_CUSTOM := TAB_CUSTOM();
    begin
        loop
          v_custom_tbl.extend;
          v_custom_tbl(v_custom_tbl.count) := REC_CUSTOM(null,...);
          fetch ref_cursor
            into v_custom_tbl(v_custom_tbl.count).my_id,
                 v_custom_tbl(v_custom_tbl.count)....,
                 v_custom_tbl(v_custom_tbl.count)....;
          exit when ref_cursor%notfound;
        end loop;
        v_custom_tbl.delete(v_custom_tbl.count);
    end;
    /
    

    SY.

    Published by: Solomon Yakobson on June 29, 2012 09:13

  • Retrieve the Ref cursor data

    Hello

    Here is the plsql code, I try to extract the data from the refcursor

    Declare
    number of l_ecg_id_in;
    number of l_error_code_out;
    l_cur_out sys_refcursor;
    Begin

    l_ecg_id_in: = 1249551;

    -Call the procedure
    pkg_dispatch.sp_getecgreport (p_ecg_id_in = > l_ecg_id_in,)
    p_cur_out = > l_cur_out, / / p_cur_out is back refcursor datat
    p_error_code_out = > l_error_code_out);


    Now my requirement is data retrieves in l_cur_out have too many columns, the columns are mentioned below.
    HUMAN RESOURCES
    PR
    DR
    BATTERY
    ETC.

    I want to just HR to be extacted in a variable or a collection of type

    We can extract a particular of ref cursor column, please suggest me



    End;

    Sudhir_Bangalore wrote:

    Now my requirement is data retrieves in l_cur_out have too many columns, the columns are mentioned below.
    HUMAN RESOURCES
    PR
    DR
    BATTERY
    ETC.

    I want to just HR to be extacted in a variable or a collection of type

    Then, you use the wrong cursor and you performance degradation because the cursor returns data that is not required.

    We can extract a particular of ref cursor column, please suggest me

    You can not.

    Workaround would be to copy the handle of the cursor ref to a handle to the cursor DBMS_SQL and then use cursor DBMS_SQL to treat the projection of SQL. But it would be an ugly hack.

    The right approach would be to correctly use the SQL cursors in PL/SQL. And no, ref Cursor in PL/SQL (created by code PL/SQL to PL/SQL code) is almost always the WRONG choice.

    There are better native cursor data types in PL/SQL in particular supported cursors created by PL/SQL and PL/SQL.

    REF CURSOR is provided mainly as the cursors created by PL/SQL for an external client. There are very few reasons to create Ref cursors to use PL/SQL code.

  • Ref Cursor on implicit and explicit cursors

    Hello

    In my company the drafting of PL/SQL procedure, everyone uses "Ref Cursor",
    But the article below, said implicit is the best, then Explicit and Ref Cursor...

    [http://www.oracle-base.com/forums/viewtopic.php?f=2 & t = 10720]

    I'm a bit confused by this, can someone help me understand this?

    Thank you

    SeshuGiri wrote:

    In my company the drafting of PL/SQL procedure, everyone uses "Ref Cursor",
    But the article below, said implicit is the best, then Explicit and Ref Cursor...

    [http://www.oracle-base.com/forums/viewtopic.php?f=2&t=10720]

    I'm a bit confused by this, can someone help me understand this?

    It has performance and it has performance...

    To explain. There is one type of cursor in Oracle - that is the cursor which is analyzed and compiled by the SQL engine and stored in the shared the database pool. The "+ client +" then receives a handle (called a SQL statement handle of many APIs) that can be used to make reference to this slider in the SQL engine.

    The performance of this slider is not determined by the customer. It is determined by the execution plan and how much enforcement of this slider cost ito of server resources.

    The customer can be Java, VB, .net - or a PL/SQL program. This client language (SQL client), has its own structures dealing with this from the SQL engine cursor handle.

    It can hide by the developer all together - so that they can't even see that there is a statement handle. That's what the implicit cursors in PL/SQL.

    It can allow the developer to manually define the structure of slider - this is what the explicit cursors, ref Cursor and DBMS_SQL cursors in PL/SQL.

    Each of these client cursor structures provides the programmer with a set of features to address different SQL cursor. Explicit cursor in PL/SQL constructs do not have the use of dynamic SQL statements. REF CURSOR and cursors DBMS_SQL do. REF CURSOR does not allow the programmer determine, at runtime, the structure of the projection of the cursor SQL. DBMS_SQL sliders do.

    Only ref Cursor can be created in PL/SQL and then handed over to another client (for example, Java/VB) for treatment. Etc.

    If each of the works of art/customer interfaces gives you a different feature for SQL cursors.

    Choose the implicit cursors for example does not the SQL cursor move faster. The SQL engine does not know and does not care, which customer construct you use to deal with the SQL cursor handle, he gave you. It does not matter. It does not affect his performance of cursor SQL.

    But on the client side, it can matter - if your code when dealing with that SQL cursor determines how fast your interaction with this SQL cursor is. How many context changes you make. How you use and reuse the SQL (for example hard vs soft analysis vs analysis reusing the same cursor handle). Etc.

    Are there any unique client cursor construction which is better? N °

    It's ignorant views. The customer's language provides a box tool, where each tool has a specific application. The competent developer will use the right tool for the job. The stupid developer will select a tool and use it as The Hammer to 'solve' all problems.

  • Put the output of the cursor without delim

    Hi all

    I simpel strives to provide some output of Ms at the user, initially I did with separator ';', as in reality, the cursor line length will be different, but user insist to remove delimiiter, saying his C app will take care of him, probably it still do not understand it might be variable length. I just played and looks like always I can't put in DMBS_OUTPUT the entire line of the cursor anyway.

    Can anyone advice what would be to circumvent this, probably I can fill up to fixed length with spases or zeros. I think that it still beter use with separator, not a big deal for C to take care of it.

    Thank you all:
    Trent


    DDL for output columns:
    NUMBER OF MM;
    ID NUMBER;
    SAL VARCHAR2 (100);

    CREATE OR REPLACE PROCEDURE ZZZ_PROCEDURE AS
    CURSOR CURS1 IS SELECT MM, JOBID, SAL CELLACC;
    BEGIN
    FOR recx IN CURS1 LOOP
    DBMS_OUTPUT. Put_line (recx. MM | « ; » || recX. JOBID | « ; » || recX. SAL);
    When the output CURS1% NOTFOUND;
    END LOOP;
    END;
    /


    and here's the output, always with delim:
    1; 1; ID has the right to create and manage users
    1; 1; ID has the right to create new cells
    1; 1; ID has the right to split existing cells
    1; 1; ID has the right to change existing cells
    1; 1; ID has the right to change several cells at the same time

    Few solutions can be as below

    1. capture all results in a plsql table collection type and return it to the user. Ask him to have hash map C App to hold that the result set retruned by your procedure/function.

    2. create a global temporary table (on delete rows commit). All the data in there inside the procedure. Return a cursor ref C app that will select the entire result set among your global temporary table.

  • How to fix the ORA-33262: analytic workspace MY_AW does not exist?

    Here's my version: http://download.oracle.com/docs/cd/E11882_01/olap.112/e10795/select.htm#CBBGEGFA

    I don't understand why I get this ORA-33262, this just doesn't make sense...
    The API should be AW ATTACH MYSCHEMA. MY_AW RO
    Solution 1: The DBA in my team think there is no way so she can create a synonym (or something like that) for the MYSCHEMA. MY_AW so I (the API) can I use only MY_AW, someone knows a way to do?
    Maybe the second call to _displayResult() needs to JOIN the AW is not the case of the first...
    Solution 2: How can I specify the API to use MYSCHEMA. MY_AW instead of MY_AW?

    Thanks in advance!
    JP

    ------

    DataProvider dp = new DataProvider();
    OracleConnection connection = (OracleConnection) connectionFactory.getConnection (); CONNECTED USING PROXY WITH USER AUTHENTICATION (CAN BE ANY USER) AUTHENTICATED TO THE WEB APP AND ACTUALLY ASK THIS TEST
    Session UserSession = dp.createSession (connection);

    MdmRootSchema mdmRootSchema = (MdmRootSchema) dp.getMdmMetadataProvider () .getRootSchema ();
    MdmDatabaseSchema mdmGlobalSchema = mdmRootSchema.getDatabaseSchema("*MYSCHEMA*");

    MdmPrimaryDimension mdmDim = (MdmPrimaryDimension) mdmGlobalSchema.getTopLevelObject (dimension.getName ());

    test.testExample (mdmDim);

    {} public void testExample (MdmPrimaryDimension mdmProdDim)

    Get the Source of the short label of the dimension attribute.
    MdmAttribute labelAttribute = mdmProdDim.getShortValueDescriptionAttribute ();
    prodShortLabel, which is the Source of the attribute description short value Dim PRODUCT_AWJ
    Source prodShortLabel = labelAttribute.getSource ();

    prodHier, which is the Source of the primary product hierarchy.
    MdmLevelHierarchy mdmProdHier = mdmProdDim.getDefaultHierarchy ((MdmLevelHierarchy));
    StringSource prodHier = mdmProdHier.getSource () (StringSource);

    levelSrc, which is the Source for the family of the primary product PRODUCT_AWJ dimension hierarchy level.
    MdmHierarchyLevel mdmHierarchyLevel = mdmProdHier.getHierarchyLevels () .iterator () .next ();
    Source levelSrc = mdmHierarchyLevel.getSource ();

    MdmAttribute mdmAncestorAttribute = mdmProdHier.getAncestorsAttribute ();
    prodHierAncsAttr, which is the Source of the attribute of ancestors in the hierarchy.
    Source prodHierAncsAttr = mdmAncestorAttribute.getSource ();

    MdmAttribute mdmParentAttribute = mdmProdHier.getParentAttribute ();
    prodHierParentAttr, which is the Source of the attribute parent hierarchy.
    Source prodHierParentAttr = mdmParentAttribute.getSource ();

    int pos = 1;
    Get the item at the specified position in the Source level.
    Source levelElement = levelSrc.at (pos);

    Select the element in the hierarchy with the specified value.
    Source scale = prodHier.join (prodHier.value (), levelElement);

    Download the ancestors of the element level.
    Source levelElementAncs = prodHierAncsAttr.join (prodHier, levelElement);
    Get the parent of the level item.
    Source levelElementParent = prodHierParentAttr.join (prodHier, levelElement);
    Download the children of a parent.
    Source prodHierChildren = prodHier.join (prodHierParentAttr, prodHier.value ());

    Select the level element children.
    Source levelElementChildren = prodHierChildren.join (prodHier, levelElement);


    Download short descriptions of value for elements of the level.
    Source levelSrcWithShortDescr = prodShortLabel.join (levelSrc);

    Download short descriptions of value for children.
    Source = levelElementChildrenWithShortDescr
    prodShortLabel.join (levelElementChildren);

    Download short descriptions of value for parents.
    Source = levelElementParentWithShortDescr
    prodShortLabel.join (prodHier, levelElementParent, true);

    Download short descriptions of value for the ancestors.
    Source = levelElementAncsWithShortDescr
    prodShortLabel.join (prodHier, levelElementAncs, true);

    Commit the current Transaction.
    Commit();

    Create Cursor objects and display their values.
    System.out.println ("values of the elements of level :");
    _displayResult (levelSrcWithShortDescr, false); WORKS WITH NO PROB, I SEE THE NORMAL OUTPUT as IN the EXAMPLE
    System.out.println ("\nLevel the element at position" + pos + ":");)
    _displayResult (levelElement, false); I READ of ORA-33262, SEE below
    System.out.println ("\nParent of the level :"); item
    _displayResult (levelElementParent, false);
    System.out.println ("\nChildren of the level :"); item
    _displayResult (levelElementChildrenWithShortDescr, false);
    System.out.println ("\nAncestors of the level :"); item
    _displayResult (levelElementAncs, false);

    }

    ' Private Sub _displayResult (Source source, boolean displayLocVal)
    {
    CursorManager cursorManager =
    dp.createCursorManager (source); ORA-33262 exception is thrown here
    Cursor cursor = cursorManager.createCursor ();

    cpw.printCursor (cursor, displayLocVal);

    Close the CursorManager.
    cursorManager.close ();
    }

    ------

    Class of error: failure of the Express
    Server error descriptions:
    DPR: failed to create the server-side, generic cursor at TxsOqDefinitionManager::crtCurMgrs4
    SALT: Impossible to generate an execution plan of the query, the credits to the TxsOqExecutionPlanGenerator::generate(TxsOqSourceSnapshot*)
    INI: XOQ-00703: error running command OLAP DML "(AW ATTACH MY_AW RO: ORA-33262: espace de travail analytique Ceccaldi AW n'existe pas.)"
    ') ', Generic TxsOqAWManager::executeCommand

    Published by: J - P on June 29, 2010 09:58

    I entered two bugs

    Bug 9864665 - OLAP API DOES NOT RESPECT the ALTER SESSION SET CURRENT_SCHEMA
    Bug 9864697 - AW POSITION OPTIMIZATION IS NOT ELIGIBLE schema

  • Five questions about OLAP makes me confused.

    1. Why do we need to map the level twice in the dimension and cube? I don't know when we cube mapping, only map the lower of
    a hierarchy. And what happens if a member of level even has been mapped with different columns of the source table?

    2. it defines several hierarchies of a dimension, then why do we need set one of them as the default hierarchy? In
    which scenario we need to define multiple hierarchies?

    3. When you create a Cube, there is an option in the aggregation-> precompute-> Cost_base aggregation - > percentage, that means
    'Percentage' used for? For a performance?

    4. when I do surgery in AWM, sometimes with a few errors. But it's really hard to understand what it is
    This means. As the error message below.
    /*********
    The transaction is not pensionable: "an error has occurred on the server.
    Class of error: failure of the Express
    Server error descriptions:
    DPR: Failed to create the server-side, generic cursor at TxsOqDefinitionManager::generic < CommitRoot >
    INI: XOQ-01600: OLAP DML error 'object OLAPTRAIN of the analytic workspace. SALESTRACK!
    There is no such thing as SALES_CUBE_PRODUCT_ALERT. "while executing DML 'SYS. AWXML! R11_MANAGE_CUBE
    ('SALES_CUBE.) CUBE' "DELETE") ', generic for TxsOqStdFormCommand::execute '.
    "
    at oracle.olapi.transaction.BaseTransaction.commit (unknown Source)
    at oracle.olapi.transaction.BaseTransactionProvider.commitCurrentTransaction (unknown Source)
    at oracle.olap.awm.dataobject.DatabaseDO.commitOLAPI (unknown Source)
    at oracle.olap.awm.dataobject.aw.WorkspaceDO.commitOLAPI (unknown Source)
    at oracle.olap.awm.dataobject.olapi.UModelDO.commitOLAPI (unknown Source)
    at oracle.olap.awm.dataobject.olapi.UModelDO.delete (unknown Source)
    at oracle.olap.awm.dataobject.olapi.UCubeDO.delete (unknown Source)
    at oracle.olap.awm.navigator.node.DeleteThread.run (unknown Source)
    ************/
    When he said "object OLAPTRAIN of the analytic workspace. SALESTRACK! There is no such thing as SALES_CUBE_PRODUCT_ALERT. "I do not yet know
    What is SALES_CUBE_PRODUCT_ALERT and where I can find the most detailed information for me solve the problem. I want to say is here
    a manual or a reference Oracle provided to help developers?

    5. is it important the order of Join Condition when we the mapping of a cube to resouce, such as a = b or b = a? What type of join is, LEFT JOIN, RIGHT JOIN, OUTER JOIN, or INNER JOIN?

    Thank you

    Satine

    You arrive on the % figure after seeing the results of time reporting and cube loading time. This can be an iterative work, but should be fruitfull later.

    Thank you
    Brijesh

    Published by: BGaur on May 11, 2009 17:02

  • How ENUM as TDMS property of reading / writing?

    LV2103, Win7

    Old road to LabVIEW, new brand tiara.

    I need to convert a structure of arbitrary complexity in properties, suitable for writing in a PDM file, in such a way that they are recoverable and (hopefully) to be readable by humans, such as whn, the file is loaded in tiara.

    I have most of it works fine, but I have trouble with ENUMs.

    An ENUM can be converted to a VARIANT very well, but that the alternative of writing to a file produced error-68007.

    A simple test shows this:

    The encoding process is quite simple - given a generic control Ref, just look at its CLASS ID.

    If the ID is one of those basic, just get its value in as a variant and add the berries of NAME and OWNERSHIP:

    If the element is a CLUSTER, then the controls that it contains and make them one by one:

    If the control is a TABLE, it is a little more difficult.  Since there is no way to obtain a reference to an arbitrary reference, you must use a reference to an item that you have.  To use it, you must show one and the same element.  This code is that, while restoring the original notice:

    HOWEVER

    ENUM, as I said earlier, converted to VARIANT very well, but TDMS will not accept it.

    Here's a technique that works, sort of:

    By converting the enum in an I32, you get the digital value from its current location and can put that into a Variant.

    During playback, the digital value will set the ENUM control correctly, so that's good.

    The problem is in the tiara, the property will look like:

    Whatever_Engine_Cycle 2

    Even if this is true and read back OK, he doesn't tell the user what kind of cycle is.

    The point of ENUMS was to put names to specific numbers.

    I tried to convert the variant to a STRING instead of an I32, but occurs 1057 (IIRC): "cannot convert a Variant to the specified type.

    A similar problem exists for controls TEXT RING - although they will go through the process, without error, what appears is a number.

    Any ideas to make the DIAdem display the string value of the ENUM, instead of a number?

    The error that says no "recognized by this version of LabVIEW" - is LV2015 to be more smart about it?

    Nice post clear! We will try for an elegant solution.  I think you're halfway there!

    You know the ID of class its an enum so get the credits of enum

    This may not work with the type defs, I leave that to you.  Rings and rings of text can be manipulated simillar

    Edit: Of course move up the chain to the variant

  • Using the procedure to display the table of multiple data

    Hi, I need help for the procedure in oracle

    I want to create the procedure to display the table of multiples with sample plan

    with a parameter imployee_id to display an employee_id, name, function, start_date, end_date

    IAM using this query to select more than one table

    SELECT e.employee_id, e.first_name, j.job_title, h.start_date, h.end_date

    E EMPLOYEES

    JOIN j jobs

    ON j.job_id = e.job_id

    JOIN the job_history:

    ON h.employee_id = e.employee_id

    WHERE e.employee_id = 200;

    Thanks for the help

    Blu and Billy showed you the 'real' solution. You can display the data returned by a cursor ref in SQL Developer, too:

    http://www.thatjeffsmith.com/archive/2011/12/SQL-Developer-tip-viewing-refcursor-output/

    Yet as a duty for a beginner is generally do not have the expected solution. Usually, teachers want to see you using a LOOP and dbms_output. something like

    DECLARE

    Xy CURSOR IS

    SELECT whatever

    As much as;

    BEGIN

    FOR r IN xy LOOP

    dbms_output.put_line (r.col1 |' # ' | r.col2);

    END LOOP;

    END;

    Of course this suggestion will inaugurate a discussion abusing DBMS output but I keep my position that it is authorized to use it for learning the basics.

  • Nestled in the issue of the loop

    Hello

    I have something like this

    begin
      for r in (select * from table_a where data_start <= sysdate) loop
        <something>
        for r_prod in (select * from table_b) loop
          for p in (
            select * from table_c where ....... and rownum = 1
          ) loop
    -- <do something>
            -- and then I want to exit from the current loop (p), and r_prod also, and jumping to the next iteration of "r" cursor.
          end loop;
        end loop
      end loop;
    end;
    /
    
    
    

    Is it possible to get out of the third loop, the second also and go to the next iteration of the hand for... loop (with continue statement)?

    Thank you!

    Just the outer loop label and use...

     

    CONTINUE outer_loop;

  • execution of stored procedure in sql developer/sql more with a table setting?

    Hello

    I create a package with a procedure which has a cursor ref as output and a type as an input parameter.  Here is my definition of the package

    PACKAGE 
    -------
    CREATE OR REPLACE PACKAGE TEST
    As
      TYPE RefCursorType IS REF CURSOR;
      type intTableType is table of varchar2(50) index by binary_integer;
      
      PROCEDURE GETDATA (
              P_RECORDS OUT RefCursorType,           
               YEAR_LIST IN intTableType
      );  
    END;
    
    
    PACKAGE BODY
    -----------------------
    
    SET DEFINE OFF
    CREATE OR REPLACE PACKAGE BODY TEST
    AS 
    PROCEDURE GETDATA
    (
      P_RECORDS OUT RefCursorType,  
      YEAR_LIST IN intTableType  
    )
    AS 
    iYearList  IDTableType;
    BEGIN 
      --GET ARRAY COUNT
      IYEARLIST := IDTABLETYPE();
      IYEARLIST.EXTEND(YEAR_LIST.COUNT);
      
      --LOOP THROUGH LISTS AND POPULATE ARRAY
      FOR I IN YEAR_LIST.FIRST .. YEAR_LIST.LAST
      LOOP
      IYEARLIST(I) := IDTYPE(TO_CHAR(YEAR_LIST(I)));
      END LOOP;
      
       OPEN P_RECORDS FOR 
       SELECT CITHTML AS FORMATTED
        FROM dbTest.FORMATTED_HTML
      WHERE YEAR IN (SELECT * FROM TABLE(IYEARLIST))
      ;
      END GETDATA ;
    END TEST ;
    /
    
    

    I want to perform this procedure from the sql or sql developer more to see if it works properly.   The year field dbTest.FORMATTED_HTML is defined as varchar2 (20 bytes).  He has many years as well as text.

    I've used this in the past with simple stored procedures, but not those with a table setting

    var r refcursor;

    exec GETOLDDATA(:r,40);

    print r;

    How can I modify this to allow him to run my stored procedure?

    Thank you

    Just declare SQL, not type of PL/SQL:

    CREATE OR REPLACE

    TYPE Str50TblType

    AS THE TABLE OF THE VARCHAR2 (50)

    /

    CREATE OR REPLACE

    THE TEST PACKAGE

    IS

    GETDATA PROCEDURE)

    P_RECORDS ON SYS_REFCURSOR,

    YEAR_LIST IN Str50TblType

    );

    END;

    /

    CREATE OR REPLACE

    TEST OF PACKAGE BODY

    IS

    GETDATA PROCEDURE)

    P_RECORDS ON SYS_REFCURSOR,

    YEAR_LIST IN Str50TblType

    )

    IS

    BEGIN

    OPEN P_RECORDS

    FOR

    SELECT CITHTML AS FORMATTED

    OF dbTest.FORMATTED_HTML

    WHERE YEAR IN)

    SELECT *.

    TABLE (YEAR_LIST)

    );

    GETDATA END;

    END TEST;

    /

    SY.

  • I am not able to create the dimension in awm

    Hello

    I am not able to create the dimension in awm.

    Error:

    The transaction is not pensionable: "an error has occurred on the server.
    Class of error: failure of the Express
    Server error descriptions:
    DPR: failed to create the server-side, generic cursor at TxsOqDefinitionManager::generic < CommitRoot >
    INI: XOQ-01801: CREATE a privilege is required for the 'PRODUCT' schema 'OLAP' object., generic TxsOqTopLevelObject::lockExclusive
    "
    at oracle.olap.awm.dataobject.dialog.PropertyViewer.doCreateAction (unknown Source)
    at oracle.olap.awm.dataobject.dialog.CreateDialogHostActionThread.doAction (unknown Source)
    at oracle.olap.awm.ui.dialog.ThreadedDialogActionThread.run (unknown Source)

    He tells this schema user u to connect have create table privilege.

    Connect as sys as sysdba and grant create table privilege to your schema user.

    This command occurs

    GRANT CREATE TABLE ;

    Mark correct or useful if this can help,

    Kind regards
    Rayan Vieira

Maybe you are looking for