Cursor to pass as a parameter in the function Operator Table

Hello

I have a Table function operator which accepts a single parameter (SYS_REFCURSOR). How can I pass Table as a cursor to the Table function?

Thank you.
-bzx

Hello

You use an operator of CONSTRUCTION to build a SYS_REFCURSOR, entries are the columns of your representative request for the ref cursor operators and the output type is an attribute of SYS_REFCURSOR. This can then be mapped to your entry table function.

See you soon
David

Tags: Business Intelligence

Similar Questions

  • How to assign values to the nested table and passes as a parameter for the procedure?

    How to assign values to the nested table and passes as a parameter for the procedure?

    Here are the object and its type

    create or replace type test_object1 as an object
    (
    val1 varchar2 (50).
    val2 varchar2 (50).
    VARCHAR2 (50) val3
    );


    create or replace type test_type1 is table of the test_object1;


    create or replace type test_object2 as an object
    (
    val1 varchar2 (50).
    val2 varchar2 (50).
    VARCHAR2 (50) val3
    );


    create or replace type test_type2 is table of the test_object2;


    GRANT ALL ON test_object1 to PUBLIC;


    GRANT ALL ON test_type1 to PUBLIC;


    GRANT ALL ON test_object2 to PUBLIC;


    GRANT ALL ON test_type2 to PUBLIC;

    Here is the table object type:

    create the table test_object_tpe
    (
    sl_num NUMBER,
    Description VARCHAR2 (100),
    main_val1 test_type1,
    main_val2 test_type2
    )


    NESTED TABLE main_val1 STORE AS tot1
    NESTED TABLE main_val2 STORE AS earlier2;


    -----------------------------------------------------------------------------------------------------------

    Here is the procedure that inserts values into the nested table:

    PROCEDURE INSERT_TEST_DATA (sl_num in NUMBER,
    Description in VARCHAR2,
    p_main_val1 IN test_type1,
    p_main_val2 IN test_type2
    )
    IS
    BEGIN

    FOR rec in p_main_val1.first... p_main_val1. Last
    LOOP

    INSERT INTO xxdl.test_object_tpe
    (
    sl_num,
    Description,
    main_val1,
    main_val2
    )
    VALUES
    (
    sl_num
    description
    test_type1 (test_object1)
    p_main_val1 .val1 (CRE),
    p_main_val1 .val2 (CRE),
    p_main_val1 .val3 (rec)
    )
    )
    test_type2 (test_object2 (p_main_val2 .val1 (CRE),
    p_main_val2 .val2 (CRE),
    p_main_val2 .val3 (rec)
    )
    )

    );

    END LOOP;

    commit;

    END INSERT_TEST_DATA;

    -------------------------------------------------------------------------------------------

    Here are the block anonymoys what values attributed to the object type and pass values in the procedure:

    Set serveroutput on;

    declare

    p_sl_num NUMBER: = 1001;
    p_description VARCHAR2 (50): = 'Test Val1;

    inval1 test_type1: = test_type1();
    inval2 test_type2: = test_type2();

    Start


    inval1 (1) .val1: = "testx1";
    inval1 (1) .val2: = "testx2";
    inval1 (1) .val3: = "testx3";

    inval2 (1) .val1: = "testy1";
    inval2 (1) .val2: = "testy2";
    inval2 (1) .val3: = "testy3";

    CSI_PKG. INSERT_TEST_DATA (sl_num = > p_sl_num,)
    Description = > p_description,
    p_main_val1 = > inval1,
    p_main_val2 = > inval2
    );

    end;
    /
    Someone can correct me.

    Thank you
    Lavan

    Thanks for posting the DOF and the sample code but whenever you post provide your Oracle version 4-digit (result of SELECT * FROM V$ VERSION).
    >
    How to assign values to the nested table and passes as a parameter for the procedure?
    >
    Well you do almost everything bad that could be hurt.

    Here is the code that works to insert data into your table (the procedure is not even necessary).

    declare
    p_sl_num NUMBER := 1001;
    p_description VARCHAR2(50) := 'Testing Val1';
    inval1 test_type1 := test_type1();
    inval2 test_type2 := test_type2();
    begin
    inval1.extend();
    inval1(1) := test_object1('testx1', 'testx2', 'testx3');
    inval2.extend();
    inval2(1) := test_object2('testy1', 'testy2', 'testy3');
    
    INSERT INTO test_object_tpe
    (
    sl_num,
    description,
    main_val1,
    main_val2
    )
    VALUES
    (p_sl_num, p_description, inval1, inval2);
    commit;
    end;
    /
    

    See example 5-15 making reference to an element of nested Table Chapter 5 using PL/SQL collections and records in the PL/SQL doc
    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/Collections.htm#CJABEBEA

    1. you don't even have the procedure because it is a simple INSERTION in the table you can do directly (see my above code)

    inval1(1).val1 := 'testx1';
    

    Since you have not yet created all the elements, there is no element 1 "inval1". You need EXTEND the collection to add an element

    inval1.extend();
    

    And then, there is an empty element, but "inval1" is a container for objects of type 'test_object1' not for scalars as "val1", "val2", and "val3".
    If you can not do

    inval1(1).val1 := 'testx1';
    

    You must create an instance of 'test_object1 '.

    inval1(1) := test_object1('testx1', 'testx2', 'testx3');
    

    And so on for the other collection

    You don't need the procedure (as my code example shows), but once you fill in the variables correctly it will work.

  • How to pass parameter in the function using the select statement?

    Hello

    I had a problem. I can't pass as parameter to the function by using the select statement. But it can pass as a parameter using the "code". How can I solve this problem?

    For example,.
    Select * from table (SplitFunction ('HS750020, HS750021')) < < < this work.

    but

    Select * from table (SplitFunction (select LOT_NO in the TRACER_SEARCH_SCHEDULE where JOB_ID = '36')) < < < do not work.

    Thank you for trying to help him. Thank you.

    Select * from table (SplitFunction (select LOT_NO in the TRACER_SEARCH_SCHEDULE where JOB_ID = '36'))< do="" not="">

    Try like this

    select * from table(select splitfunction(lot_no) from tracer_search_schedule where job_id='36')
    

    Just make sure that your subquery returns only 1 row.

  • How do the function of table 1 d search case-insensitive for the array of strings

    How do the function of table 1 d search case-insensitive for the array of strings

    Hi Karine,.

    convert the two (table and search for the string) to lowercase before using this feature...

  • Pass the parameter to the functions called from a dll

    Hi all

    I am interfacing a motor controller for PMC - 100 through the Protocol of Performax using labwindows.

    I need to explicitly link the PerformaxCom.dll and call functions with him. I'm calling this function

    BOOL fnPerformaxComOpen (DWORD IN dwDeviceNum, OUT HANDLE * pHandle);

    Faithful:

    If you want to link explicitly, you can consult this article: http://zone.ni.com/devzone/cda/tut/p/id/8503

    It has a code snippet that shows passing two parameters to a DLL function.

    But as for your statement that "I don't know how to pass parameter to him", in the example, you reference, you pass a parameter: it's just a constant string rather than a variable.

  • How to pass parameter in the function extract (for XMLTYPE)

    I have a table with XMLTYPE field xml_column PROBLEMXML. In this column, there are many deffinitions for the problem. There is no amount deffinitions max and there can be no definition at all. I need to return all the definitions of all the problems a string wirh separate definitions by '; '.

    Query
    SELECT extract (prob. Def,'/definitions/definition[1]/@var'). ';'|| excerpt (prob. Def,'/definitions/definition[2]/@var')
    OF PROBLEMXML j.
    XMLTABLE)
    "/ problem.
    PASSAGE j.xml_column
    Probid VARCHAR COLUMNS (31) PATH ' / problem/@id',
    Prob def XMLTYPE PATH ' / problem/definitions ")
    where PROBLEM_ID = 1;
    Returns exactly what I want one; m.
    But
    declare
    my_variable varchar2 (2000): = null;
    number of N1;
    number of N2;
    Start
    N1: = 1;
    N2: = 2;
    SELECT extract (prob. Def,'/definitions/definition[N1]/@var'). '|'|| excerpt (prob. Def,'/definitions/definition[N2]/@var') in my_variable
    OF ETL_PROBLEMXML_STG_T j.
    XMLTABLE)
    "/ problem.
    PASSAGE j.xml_column
    Probid VARCHAR COLUMNS (31) PATH ' / problem/@id',
    Prob def XMLTYPE PATH ' / problem/definitions ")
    where PROBLEM_ID = 1;
    dbms_output.put_line ($my_var);
    end;
    Returns null.
    Is there a way to switch the setting to extract the function?

    You have string literal death of n1 and n2. Note the change to select it.

    DECLARE
      my_var VARCHAR2(2000) := NULL;
      n1     NUMBER;
      n2     NUMBER;
    BEGIN
      n1 := 1;
      n2 := 2;
      SELECT extract(prob.def, '/Definitions/Definition[' || n1 || ']/@var') || '|' ||
             extract(prob.def, '/Definitions/Definition[' || n2 || ']/@var')
        INTO my_var
        FROM etl_problemxml_stg_t j,
             xmltable('/problem' passing j.xml_column columns probid VARCHAR(31) path '/problem/@id',
                      def xmltype path '/problem/Definitions') prob
       WHERE problem_id = 1;
      dbms_output.put_line(my_var);
    END;
    

    Published by: RPuttagunta on December 13, 2010 09:18

  • Passing parameter to the function header javascript problem

    Hi - I'm trying to pass a string to a javascript function. The javascript function is called an onchange
    event in the attributes of a page element HTML form elements. The call looks like this:

    OnChange = 'lookupObjTypeID ("P3_OBJECTTYPE_NAME")'; (Yes, I want to pass the name of the element, not its value)

    The JavaScript looks like this:

    < script LANGUAGE = "JavaScript" src = "http://www.json.org/json.js" > < / script >
    < script type = "text/javascript" >

    function lookupObjTypeID (source_item_name) {}

    Alert ("running javascript");
    Alert (' name of the Source element: ' | source_item_name);
    }
    < /script >

    The first alert prints the message; the second alert but the source_item_name is null.

    Everything I've seen, this is the right syntax. What's not?

    Thank you
    Carol

    Carol

    Is the in js concatenation operator ' + '. Then

    Alert (' name of the Source element: "+ source_item_name);

    should work.

    CITY

  • Passing Parms of event click the function and 'child '.

    With the help on this Forum, I'm able to pass the parms in a custom context menu based on TitleWindow created with the PopUpManager to a click event.  Now, I would also spend parms to change a Manager click on the PopUp itself event.  Is this possible?  Here is the code for the click event in the context menu:

    From main MXML file - creates the PopUp:

    private

    var popup: owPopUp = new owPopUp();

    protected function owPopUpWindow (event: MouseEvent, title: String, url1:String):Sub

    {

    PopUpManager.addPopUp (popup,

    ce , true );

    Popup.title = title;  title = '{text}' in the tag < s:TitleWindow... >.

    Popup.x = 200;

    Popup.y = 125;

    }

    Code for the click (a text in a text box) event

    a click = "owPopUpWindow (event, '.

    ' New EBS: order writer - queue of Milestone 1' "lessons/EBS_new_Milestone1.swf" ) "//third parm is what I want to pass to the function in the PopUp TitleWindow (underline) .

    In the TitleWindow PopUp created by the above code:

    ...

    [

    Bindable [ ] public var titleText:String =""; .

    [Bindable] public var url1:String = "";

    protected

    function textarea1_clickHandler(event:MouseEvent):

    Sub

    {

    ce .move (1,1);

    Loader.Load)

    'url1' );  This URL is where I would like to pass in a parm to the event click above 'url1 '.

    }

    protected function pdfLoader(event:MouseEvent):Sub

    {

    navigateToURL (new URLRequest (url2));  I would also like to pass parm for this URL 'url2.

    }

    The role of title works, but does not work part url1.  No error, just no load.  Any suggestions?

    Thank you.

    Create your own event accommodating more parms.

    This is possible by creating a class that extends MouseEvent.  Add some parms you need for this event and be sure to call super.

    You can then send this event as need and also get the parms that you must listen to

    http://StackOverflow.com/questions/426540/how-to-create-custom-MouseEvent-click-event-in-a s3 pass parameters of function

    #4 comment should help you.

  • not able to pass the table name as parameter in the function

    Hello

    I am not able to move from tablename as parameter. I use the below function.
    -------------------------------------------------------------------------------------------------

    function count_test (tabname varchar2) return number is
    l_count number;
    Start

    Select count (*) IN the tabname FROM l_count;

    RETURN l_count;
    END;

    You can not do with static SQL.

    The only way is to do it with dynamic SQL:

    EXECUTE IMMEDIATE ' select count (*) FROM ' | tabname INTO l_count;

    Kind regards.
    Al

    Published by: Alberto Faenza 10 may 2012 01:44
    Misspelling

  • pass values of parameter to the procedure stored in the URL, possible?

    Hi, everyone, our system is Apex4.0.2 in Linux CentOS 5 on Oracle 11 g 2, here is the procedure:

    create or replace procedure test_public (Cust_id integer)
    is

    Start
    owa_util.mime_header ("text/xml", FALSE);
    owa_util.mime_header ("application/octet", FALSE);
    -Close the HTTP header
    owa_util.http_header_close;

    HTP.p (DBMS_XMLGEN.getXML ("SELECT * FROM demo_orders where customer_id ='|")) cust_ID));
    end;

    +/+

    the call to the stored procedure is SUCCESSFUL when Test_public has no parameters, as:
    http://myserver/Apex/myschema.test_public (OK)
    the question is: I want to spend the 3 settings in my stored procedure (on production procedure), do not know how?

    Any suggestions are greatly appreciated

    create or replace procedure test_public (param1, param2 IN VARCHAR2, param3 in NUMBER IN number)

    http://myserver/apex/myschema.test_public?param1=¶m2=¶m3=
    
  • Pass the parameter to the function onRelease

    Hello

    Is it possible to pass parameters to mc.onRelease?

    Thank you

    aobs

    No, but is not necessary.  You can assign properties to your movieclip and get back them in your onRelease:

    mc.clickedNum = 0;

    {mc.onRelease = function ()}

    this.clickedNum ++;

    }

  • Passing a unique structure through the functions of customer/ServerTCPRead/write and making sure that all data is transferred

    I use the CVI TCP media kit at my request and I am curious about the following code:

    ClientTCPRead

    char * buffer;
    int messageSize;
    int bytesToRead;
    int
    bytesRead;

    / * Find messageSize and allocate a buffer properly... * /.

    bytesToRead = messageSize;

    While (bytesToRead > 0)

    {

    bytesRead = ClientTCPRead (connection handle,
    (& buffer [messageSize - bytesToRead], bytesToRead, 0);

    bytesToRead = bytesRead;

    }

    OK, this works if you tank elements of the array, but what happens if you pass a structure of arbitrary size?  If you read/write the bytes read or written and that you get all the data that you have asked, what do you do at this point to get the rest of subsequent data?  For example, replace the "buffer" of type char with a structure of a type defined by the user with a size of 100 bytes or something to that extent.  You make a request for read/write and read/wrote less than 100 bytes.  How do you get the rest of the data?  ICB doing something in the background?  I could use this code with several structures, but then again, a particular Member of a structure is not the size of a byte as a tank.

    Much appreciated,

    Chris

    The solution is to use a pointer to char sunk to allocate the data transmitted.  The only problem is that this buffer must be a pointer to the data type of the structure before a tank troop can be used for a successful program compilation. Thank you for your help.

    Chris

  • Collection as a parameter in the function - help needed

    I have a function that returns 3 different values according to a given in parameter.
    Now, I want to return these three values.
    Instead of using three out parameters, how can I use a collection for return values.

    Please tell me the best way that returning multiple values (more than 3)

    Thanks in advance

    Concerning
    Rambeau
    SQL> create type my_obj as object (no integer, name varchar2(10))
      2  /
    
    Type created.
    
    SQL> create type my_tbl as table of my_obj
      2  /
    
    Type created.
    

    functional approach...

    SQL> create or replace function my_fn return my_tbl
      2  as
      3     ltbl my_tbl;
      4  begin
      5     select my_obj(1,'karthick') bulk collect into ltbl from dual;
      6
      7     return ltbl;
      8  end;
      9  /
    
    Function created.
    
    SQL> select * from table(cast(my_fn() as my_tbl))
      2  /
    
            NO NAME
    ---------- ----------
             1 karthick
    

    procedureal approach...

    SQL> create or replace procedure my_proc(ptbl out my_tbl)
      2  as
      3  begin
      4     select my_obj(1,'karthick') bulk collect into ptbl from dual;
      5  end;
      6  /
    
    Procedure created.
    
    SQL> declare
      2     ltbl my_tbl;
      3  begin
      4     my_proc(ltbl);
      5
      6     for i in 1..ltbl.count
      7     loop
      8             dbms_output.put_line(ltbl(i).no||'      '||ltbl(i).name);
      9     end loop;
     10  end;
     11  /
    1       karthick
    
    PL/SQL procedure successfully completed.
    
  • RandomGen elements, case structure nothing if it's false, while the loop passes iterations, can not get the values in table outside the structure of the case

    Hello!

    I tried to build a trigger that triggers a true value each 1000 milliseconds (from the first real);

    which real command structure box to a value of the randomNrGen of the sample and place it in a table.

    but I would like to USE this table and I can't do this beacause I can not get out of the structure of the case.

    AND:

    the while loop ignores samples; If you run the vi and look at the speed at which the table fills, ypu notice it is not periodic: the first few items are inserted at 1 second interval, but then it jumps one;

    would it be because of the wait time 1ms?

    1. How can I create a structure that does this:

    If set to True, it samples a value from Genesis at random and places it in the table

    OTHERWISE, it does NOTHING, without zeros sent to the table just waiting for the next true and only the values sampled at True remain in the table?

    2. How can I stop it pop samples (multiples of 1000 in my case)?

    In conclusion: I need to be able to take samples on the sample generator and store them in an array of 3d in a zig - zag (1.jpg) way, but able to think about it, we need to go beyond these two questions.

    Please ignore the meter.

    Please help me!

    TibiG wrote:

    Thanks, Crossrulz!

    This did not omit all values and it works fine.

    Is it possible to get information in a case without making use of the large loop?

    My program will become very complex (I need to synchronize a magnetometer and a stepper motor to make a 3d map of the magnetic field of the magnet) and I want to do everything as simple as possible.

    If there is a way to get information about a case structure, other tnan using registers with shift on the big loop, and you know it, please show me.

    Thank you!

    You could also use a Feedback node, just keep it out of the structure of the case.

  • Implementation of the functions of table (indexOf, lastIndexOf, removeDuplicates...)

    Hello

    I'm trying to implement some functions to manipulate tables more easily, as I would with other programming languages (Array.IndexOf exists in Javascript, but seems to be absent from ExtendScript).

    First of all, I tried to add these functions using Array.prototype; Here's what I've done for two of these functions:

    Array.prototype.indexOf = function (value)
            {
              for (var i = 0;i<this.length;i++)
                {
                    if (this[i] == value) return i;
                }
                return -1;
            }
           
    Array.prototype.removeDuplicates = function ()
            {
                var removed = [];
                for (var i = 0;i<this.length-1;i++) {
                        for (var j=i+1;j<this.length;j++) {
                            if (this[i] == this[j]) {               
                                removed.push(this.splice(j,)1);
                            }
                        }
                    }
                    return removed;
            }
    

    It seemed to work fine, but I discovered that it breaks this kind of loop:

    for (var i in array) {
         alert(array[i]);
         }
    

    The loop through the values in the table and continues beyond array.length with the features added to the prototype.

    As explained here, I have found a workaround, using Object.defineProperty () rather than implement functions in Array.proptotype

    Object.defineProperty(Array.prototype, "indexOf", {
      enumerable: false,
      value: function(value) {
          for (var i = 0;i<this.length;i++)
                {
                    if (this[i] == value) return i;
                }
                return -1;
        }
    });
    

    But... Object.defineProperty () is missing in ExtendScript too!

    I don't know what to try next... Any idea?

    Thank you!

    The primary reason that some of these functions do not exist, is that ExtendScript is based on the ECMA-262 standard. Very old JavaScript and I don't think all this is implemented.

    PG. 3 of the CS6 script guide (only written comprehensive guide Adobe has for the moment) after effects Developer Center | Adobe Developer Connection:

    The ExtendScript language

    "After Effects scripts using the Adobe ExtendScript language, which is an extended form of JavaScript used by several applications Adobe, including Photoshop, Illustrator, and InDesign. ExtendScript implements the JavaScript language according to the ECMA-262 specification. The After Effects script engine supports the 3rd edition of the ECMA-262 standard, including its conventions of notation and lexical, types, objects, expressions, and statements. ExtendScript also implements the E4X ECMA-357 specification, which defines the access to the data in XML format. »

    Even though I know that many developers have made prototyping, I found it to be annoying personally, especially if your code moves outside your machine. I just made autonomous functions for all my scripts. It has been easier to reuse code and create some (not all) missing features that would be nice to have the day current Javascript.

Maybe you are looking for