pass an array as parameter

is it possible to pass an array as a parameter to the
 PROCEDURE PRINT_REP_WEB  
It is:
     ADD_PARAMETER(PL_ID, 'P_1',     TEXT_PARAMETER,'G12-303B2','G12-306B','G12-408B','G12-515B1'); 
and using ' in (: p_1) "report of the query.

-----
Forms [32 bit] Version 10.1.2.0.2 (Production)
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
10.1.2.0.2 generator

has obtained assistance here
{: identifier of the thread = 2416695}
{: identifier of the thread = 2412912}

Tags: Oracle Development

Similar Questions

  • pass an associative array as parameter?

    Hello

    is it possible to create a table associative w/o using a variable to pass it as a parameter to a function?

    As:

    new Array(["ID":"timeout"])

    But it does not work.

    TIA

    Don't know what you're trying to do, but an associative array is an object base type.

    This will create an array containing a single element of the object:

    new Array ({ID: "timeout"}) / / note the braces

  • Passing an array as a parameter of java (java controls) for the stored procedure

    Hello

    I use java controls (BEA Weblogic Workshop 8.1) to call a stored procedure and send an array as a parameter to the stored procedure of java. The following code throws an exception 'Fail to convert the internal representation.

    Java code
    import com.bea.control.DatabaseControl.SQLParameter;

    Here I create the java
    int [] = {12,13,14} javaArray.

    The code below is used to create the table from sql to oracle for the procedure
    SQLParameter [] params = new SQLParameter [1];
    Object obj0 = javaArray;
    params [0] = new SQLParameter (obj0, oracle.jdbc.OracleTypes.ARRAY, SQLParameter.IN);

    the code below calls the myFunc in file OJDBCtrl.jcx
    String success = dbControl.testFunc (params);

    OJDBCtrl.jcx
    /**
    * @jc: = sql statement ' call CMNT_TST_PROC (?)).
    */
    String Myfunc (SQLParameter [] param);

    The stored procedure that is used:

    SL_tab IS NUMBER TABLE INDEX BY PLS_INTEGER;
    Procedure cmnt_tst_proc (cmnt_tst sl_tab);
    Procedure cmnt_tst_proc (cmnt_tst sl_tab) is
    BEGIN
    dbms_output.put_line ('Hello');
    END;


    I'm getting the following exception

    Failure = Java.Sql.SqlException: Internal failure to convert the representation: [I@438af4 [ServiceException] >]
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
    at oracle.jdbc.driver.DatabaseError.check_error(DatabaseError.java:861)
    at oracle.sql.ARRAY.toARRAY(ARRAY.java:210)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7768)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7449)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7837)
    at oracle.jdbc.driver.OracleCallableStatement.setObject(OracleCallableStatement.java:4587)
    at weblogic.jdbc.wrapper.PreparedStatement.setObject(PreparedStatement.java:244)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl._setParameter(DatabaseControlImpl.jcs:1886)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl.getStatement_v2(DatabaseControlImpl.jcs:1732)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl.invoke(DatabaseControlImpl.jcs:2591)
    at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:377)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:433)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:406)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:249)
    at com.bea.wlw.runtime.jcs.container.JcsContainer.invoke(JcsContainer.java:85)
    at com.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(BaseContainerBean.java:224)
    at com.bea.wlw.runtime.core.bean.SLSBContainerBean.invoke(SLSBContainerBean.java:109)
    at com.bea.wlwgen.StatelessContainer_ly05hg_ELOImpl.invoke(StatelessContainer_ly05hg_ELOImpl.java:153)
    ...

    Can you please let me know, what am I doing wrong and how can I pass an array to a procedure/function using java controls.

    Any help will be much appreciated.



    Published by: user12671762 on February 24, 2010 05:03

    Published by: user9211663 on February 24, 2010 21:04

    Try using an oracle.sql.ARRAY with a nested table or varray instead of a table index. Create the type SQL and Java object as follows

        SQL> create type sl_tab as varray(3) of integer;
        Java:
            ArrayDescriptor ad = ArrayDescriptor.createDescriptor
                (".SL_TAB", java.sql.Connection);
            Object elements = new Object[3];
            elements[0] = new Integer(12);
            elements[1] = new Integer(13);
            elements[2] = new Integer(14);
            oracle.sql.ARRAY array =
                new oracle.sql.ARRAY(ad, oracle.jdbc.OracleTypes.ARRAY, elements);
            SQLParameter[] params = new SQLParameter[1];
            params[0] =
                new SQLParameter(array, oracle.jdbc.OracleTypes.ARRAY, SQLParameter.IN);
            String succ = dbControl.testFunc(params);
    

    I don't think that you can pass an array of Java, this is why you have more success using an oracle.sql.ARRAY with a SQL varray. -Michael-

  • by passing the array of strings of Teststand to LV dll

    Hello

    I wonder, why is it not possible to pass an array of strings 1 d of TestStand to a dll, which is compiled with LabView. By the way the PropertyObject works very well, but as parameter category "Array of Strings" exist in the call dll TestStand pane, it should be possible to pass an array directly. I get an empty dialog box, where I try to view the contents of the array passed directly.

    Why it does not work?


  • How to pass a number any parameter in a call sequence

    Hello

    I have a sequence that is intended to do the same job for one or more of the same items typed. for example:

    ______________

    subsequenceA:

    (all table elements) ForEach element

    do the work

    ENDFOR

    ______________

    now in my caller, I want to call subsequenceA in several ways:

    subsequenceA (firstElement)

    subsequenceA (PremierElement, DeuxiemeElement)

    subsequenceA (PremierElement, DeuxiemeElement,..., lastElement)

    Is this possible?

    Another question: is it possible to appeal a subsequence in an expression of pre?

    No, calling the subsequences can be done using the step of SequenceCall. At least, it is not easy to make another way (because it requires a lot of knowledge of the TS API).

    Why you not pass the array "such what '... (array parameter)?

    Norbert

  • Pass an array to a node form

    I have an example of table [0, 2, 4, 6, 8]. I want to pass this array to a knot of formula that calculate the square of each element of the input array and show the resulting table.

    For example, the formula is 'square '. Output array should be [0, 4, 16, 36, 64]

    I did not like it, but there was an error...

    Can someone please?

    Here's how you do it with a knot of formula.

    Can you tell me which seems easier to code?

    It took me 2 seconds using the square function.  And 10 minutes to get the syntax for the node of the formula.

  • How pass an array into a php url using the flex http service?

    How pass an array into a php url using the flex http service?
    im making something like this:
    http://localhost/flex_php/example_return_xml.php?id= {mylist}
    -mylist? TABLE
    -If I try to use a text variable it works for example. {myvar.text} where myvar is a text input

    Any idea!

    How can I get using XML?
    I tried to push the table in a textinput & sent the text of entry in php, it worked!

  • Passing % ROWTYPE array to a stored procedure using JDBC

    Hello

    I have the following code:

    create or replace package PCK_COLLECT_MESSAGES_CSR
    as
    TYPE TY_TA_KPMESSAGE_ROWTYPE IS TABLE OF M_MESSAGECOLLECTION % ROWTYPE;
    procedure insert_messages (messages IN TY_TA_KPMESSAGE_ROWTYPE);
    end PCK_COLLECT_MESSAGES_CSR;

    I would like to pass an array of M_MESSAGECOLLECTION % ROWTYPE to the stored procedure using JDBC, because I want to use the FORALL statement to perform a quick insert in the procedure.

    Is this possible using JDBC? Oracle version is 10g.

    Thank you in advance,
    Kind regards

    Markus.

    % rowtype declarations are native to pl/sql and are not accessible from outside its limits, something to think about when you're designing apis.

    To work around the problem, you can create an anonymous pl/sql block that can access the definitions of % rowtype.

      String sql = "declare r dual%rowtype; begin r.dummy := :x; end;";
    
      CallableStatement cs = conn.prepareCall(sql);
    
      cs.setString(1, "x");
    
      cs.execute();
    
  • How to pass an array as a parameter to a stored procedure

    Hi all
    I want to pass the name of a table as a parameter in a stored procedure, which will be used for cursors, etc..
    But when I pass the parameter and I compile the S.P. he gives me error (error: table exist not...)

    Any help?

    Thanks in advance, Marco

    Cannot open a cursor explicit when it comes to the dynamic table names or parameters. This is because the explicit and implicit cursors seek real table names since they are static.
    Here your name of the table is dynamic, so u need to use dynamic that is ref cursor to and not static cursor.

    I made the correction in the code below. Run it and check the result!

    CREATE OR REPLACE PROCEDURE "P_1" ( TAB1 VARCHAR2)
    AS
    field1 CHAR(5);
    field2 CHAR(5);
    
    c1 sys_refcursor;
    
    begin
    
    l_str := 'select a,b,c from '||tab1||' INNER JOIN tab2 ON a = .......';
    open c1 from l_str;
    
    /*OPEN C1;
    CURSOR C1
    IS
    SELECT a, b , c
    FROM TAB1
    INNER JOIN
    tab2
    ON a = .......
    OPEN C1;*/
    
    LOOP
    FETCH C1
    INTO ..... 
    
    EXIT WHEN C1%NOTFOUND;
    .....
    END;
    END LOOP;
    
    CLOSE C1;
    
    EXCEPTION
    WHEN OTHERS
    .....
    END;
    
  • Best way to pass an array between TestStand, CVI

    Hello

    I was not able to judge or to find the best practice to pass arrays between TestStand and CVI. I'd preferably done in pass pointer to array. For example, if I have a function written in CVI DLLs:

    int GetAverage (double* aBuffer, double aSize, double* aAverage)
    

    TS I have an aBuffer double array [100]:

    -I can't simply pass

    GetAverage (aBuffer, 100, &aAverage)
    

    - or, I can go:

    GetAverage (&aBuffer[0], 100, &aAverage)
    

    -The only thing that is TestStand accepts:

    GetAverage (aBuffer[100], 100, &aAverage)
    

    I don't think not good because the size is just repeated.

    I had no problem if I could write

    GetAverage (aBuffer[100], &aAverage)
    

    but the problem is in this case there is no possibility fo CVI to determine the size of the table, like sizeof (aBuffer) just return, sizeof (double).

    Can you provide me with advice for best programming practices in this case?

    Concerning

    RB

    Hello

    Just in addition:

    Is there another way to access the tables.

    Often, I use for this task, the TS-API. The only parameter you need is in this context of the sequence.

    Maybe you should also visit this example:

    TestStand 2010\Examples\AccessingArraysUsingAPI\UsingCVI\AccessingArrays.seq

    Concerning

    Jürgen

  • Pass the array to the formula node Eval (any chance to avoid this?)

    Hello

    I have not installed on my PC of MATLAB.

    I need to be able to say from the entry Panel custom formula "y = sin(Fm*2*pi*t[i]) + 2 * sin(3*Fm*2*pi*t[i]) + 3 * sin(4*Fm*2*pi*t[i])..."

    This form may contain a variable of harmonics (sine or cosine functions), but strict number of input parameters: Fm, t [i].

    FM - is a frequency.

    [i] t - is a time (ramp model) which is a table

    Can I pass array as a parameter of t [i] entry in formula node? How to do what other parameters, which are constants?

    Is there another method how to implement this - using the variable functions count?

    You are still far too complicated and it's still not scalable for a variable number of terms. You must be able to get out of math based text and think in terms of real LabVIEW.

    Here's a quick example using the terms in your first post (I show only a picture, because I have more LabVIEW 7.1).

    Modify if needed.

    NOTE:

    If you have more than a couple of terms generally, I tenacious feel that it would be simpler to configure a table complex stick (with the desired amplitude and frequency positions) and do an inverse FFT on this.

  • by passing the array of objects to the procedure

    Hi, I wrote a procedure to accept the array of input objects. It has worked well.

    This is the only setting of entry in my Interior.

    But now, I tried to add a off set the parameter of type varchar2 to my procedure to send a return value, but it gives me an error

    PLS-00410: fields in duplicate in the FOLDER list, TABLE or argument are not allowed.

    Please suggest cant I pass all other arguments when using an array of record or an object as a parameter?

    This is my code
    CREATE OR REPLACE TYPE PREF_OBJ_TYPE as object (
    
     PREF_CD  varchar2(20),
     USR_ID   VARCHAR2(20),
     PROD_CD  VARCHAR2(50),
     DFLT_PREF_VAL_TX VARCHAR2(250),
     USR_PREF_VAL_TX VARCHAR2(250),
     CRE_USR_ID VARCHAR2(20),
     UPDT_USR_ID VARCHAR2(20) );
    /
    
    
    
    
    CREATE OR REPLACE TYPE PREF_ARRAY is table of PREF_OBJ_TYPE;
    
    CREATE OR REPLACE procedure MMM(in_pref PREF_ARRAY,v_err out varchar2 )
    is
    
    v_prod_dim_nb NUMBER;
    v_usr_dim_nb  NUMBER;
    v_count NUMBER;
    v_err varchar2(50);
     
    
    begin
    
    for i in  in_pref.first.. in_pref.last
    
    LOOP
    
    /* Derive the product and user dim numbers */
    
    select prod_dim_nb into  v_prod_dim_nb from prod_dim where prod_cd=in_pref(i).prod_cd ;
    select usr_dim_nb into v_usr_dim_nb from usr_xref where usr_id=in_pref(i).usr_id and sys_id='ACCESS';
    
    
    /* check if the record already exist in usr_prod_pref corresponding to that  user,prod,pref */
    
    select count(1) into v_count from usr_prod_pref_test where prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    
    if v_count=0 then 
    
    BEGIN
    
    INSERT INTO USR_PROD_PREF_TEST values(v_usr_dim_nb,in_pref(i).pref_cd,v_prod_dim_nb,in_pref(i).DFLT_PREF_VAL_TX,in_pref(i).usr_PREF_VAL_TX,'Active',NULL,
    in_pref(i).cre_usr_id,sysdate,in_pref(i).updt_usr_id,NULL);
    
    
    
    END;
    
    else 
    
    
    
    update USR_PROD_PREF_TEST set USR_PREF_VAL_TX=in_pref(i).USR_PREF_VAL_TX,DFLT_PREF_VAL_TX=in_pref(i).DFLT_PREF_VAL_TX,UPDT_USR_ID=in_pref(i).updt_usr_id,updt_dt=sysdate,cre_usr_id=in_pref(i).cre_usr_id where 
    prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    
    
    end if;
    
    
    end loop;
    
    commit;
    
    v_err:='abc';
    
    end;
    /
    Published by: raj_fresher on October 9, 2009 06:56

    Why the 6001 number is assigned to the error code? Oracle generates error code right... Why the procedure does not use this number move like to help put
    r_v_errod_cde and r_v_error_msg?

    I don't know who wrote at the beginning of this procedure, but no doubt he wanted to use some 'custom error handling?
    Furthermore, I don't see anything happening with R_V_ERROR_CODE and R_V_ERROR_MSG, or did you leave this part out of your snippet?
    This way of using a WHEN of OTHER (not followed by a RAISE) is considered to be a 'bad practice' / a bug.

  • Pass an array of real-time desktop PC

    Hello

    I recently started using LabVIEW Real time. I want to transfer an array of data from a PC to office to a PC in real time. The data transfer is time and once real PC will make further processing of the data. I'm using LabVIEW 8.2 and the corresponding version of the time real LabVIEW. I do not understand how to program the time real PC to receive all the elements of the array in the order. Below is a brief description of what I've tried so far.

    At the beginning, I created a shared variable on the computer which was the data type double target. I activated "Buffering" and set the size as 10 double rooms. Enable FIFO tab real-time time real FIFO, selected several items and set the size as 10 double rooms. On the desktop, I used a loop for to transfer all the elements of the array in the shared variable. I used a 500 ms delay in the loop for debugging purposes. On the target side PC, I used a while loop, the same delay of 500ms and built a table reading the shared variable. To run the program, I ran the VI on the target PC and then the VI on the host. I could see that the painting was being filled with data from the host computer, but the first element of the array of host PC has been filled in the second element of the array on the computer target. Another problem, is that there is no way to prevent the target computer that the host PC had sent all the data and he had to stop the filling of the table. The first problem with lag of data can be attributed to the timing. But I don't know how to solve problems.

    I also tried declaring the variable shared on the computer target with the double data type 'Array of '. But when the data is passed from the host PC for the target computer, I don't see the variables reflected on the target computer.

    Is could someone please tell me what error I do here?

    Hello

    The problem has been resolved. It is LabVIEW time real 8.20 which has been altered. Therefore, did a re-installation of LabVIEW. Now I have the sample project attached (ex2.zip) in the previous post works perfectly. Thank you for your help.

    Kind regards

    Prashant

  • Pass an array of bytes to the oracle stored procedure

    I have a problem with moving from byte array in Oracle stored procedure as an input parameter by using odp.net.

    Here is the signature of the stored procedure:

    SOMEPROCEDURE(session IN NUMBER, data IN RAW)

    Here is c# code, which calls the procedure:

    var cmd = new OracleCommand("SOME_PROCEDURE", _connection);

    cmd.CommandType = CommandType.StoredProcedure;

    var bt = new byte[]{1,68,0,83,128,1};

    OracleParameter sessionId = new OracleParameter("dbSessionId", OracleDbType.Decimal, new OracleDecimal(_dbSessionId), ParameterDirection.Input);

    OracleParameter data = new OracleParameter("statusData", OracleDbType.Raw, new OracleBinary(bt), ParameterDirection.Input);

    cmd.Parameters.Add(sessionId);

    cmd.Parameters.Add(data);

    cmd.ExecuteNonQuery();

    This code does not (stored procedure throws exception, which cannot receive), because in byte array hadou number 128!, if I display 128 on another number, minus 128, it works great!

    What should I do?

    After some tests I found the solution. Initially, you cannot switch to the array of bytes via the odp.net stored procedure, if the table contains 127 large values.

    Yes, solution: 1. create the wrapper procedure

    procedure SOME_PROCEDURE_WRAPPER (p_session_id in number, p_data  in varchar2)
     is v_data raw(1024);
     rawdata raw(1024); 
     rawlen number;
     hex varchar2(32760);
     i number;
     begin
      rawlen := length(p_data);
      i := 1;
      while i <= rawlen-1
      loop 
     hex := substrb(p_data,i,2); 
         rawdata := rawdata || HEXTORAW(hex); 
         i := i + 2; end loop; 
         SOME_PROCEDURE(p_session_id , rawdata); 
     end;
    

    2 then need to modify the code c# in this way:

     var cmd = new OracleCommand("SOME_PROCEDURE_WRAPPER", _connection);
     cmd.CommandType = CommandType.StoredProcedure;
     string @string = statusData.ToHexString();
     OracleParameter sessionId = new OracleParameter("dbSessionId", OracleDbType.Decimal, new OracleDecimal(_dbSessionId), ParameterDirection.Input);
     OracleParameter data = new OracleParameter("statusData", OracleDbType.Varchar2,@string.Length, new OracleString(@string), ParameterDirection.Input);
     cmd.Parameters.Add(sessionId);
     cmd.Parameters.Add(data);
     cmd.ExecuteNonQuery();
    

    where

    public static string ToHexString(this byte[] bytes)
     { 
         if(bytes == null || bytes.Length == null)
               return string.Empty;
          StringBuilder hexStringBuilder = new StringBuilder();
          foreach (byte @byte in bytes)
          { 
              hexStringBuilder.Append(@byte.ToString("X2")); 
          } 
          return hexStringBuilder.ToString();
     }
    
  • Passing object as a parameter

    Hi all

    I have a procedure that takes an OBJECT as a parameter. I use SQL Developer and also have SQL * more.


    The type is


    create or replace
    TY_RAILROAD_OPERATOR THAT the OBJECT TYPE
    (
    RRX_RAILROAD_OPERATOR_CD VARCHAR2 (6 BYTE),
    RRX_RAILROAD_OPERATOR_NM VARCHAR2 (60 BYTE),
    RRX_RAILROAD_OPERATOR_DSC VARCHAR2 (2000 BYTE),
    STATUS CHAR (1 BYTE),
    DATE OF LAST_UPDATE_DT,
    LAST_UPDATE_USER VARCHAR2 (60))



    procedure set_Railroad_Operator (p_TY_Railroad_Operator IN TY_Railroad_Operator, p_Railroad_Operator_Id OUT NUMBER) IS

    v_Railroad_Operator_Id NUMBER;

    BEGIN
    ..
    .
    .
    I run the procedure. How should I pass parameters?

    I would like to test the procedure, and I have no idea how to do to test it.

    Any help is appreciated.


    Thanks in advance
    N

    sample:

    SQL> CREATE OR REPLACE TYPE ty_railroad_operator AS OBJECT(
      2     rrx_railroad_operator_cd    VARCHAR2(6 BYTE),
      3     rrx_railroad_operator_nm    VARCHAR2(60 BYTE),
      4     rrx_railroad_operator_dsc   VARCHAR2(2000 BYTE),
      5     status                      CHAR(1 BYTE),
      6     last_update_dt              DATE,
      7     last_update_user            VARCHAR2(60)
      8  );
      9  /
    
    Type created.
    
    SQL> CREATE OR REPLACE PROCEDURE set_railroad_operator(
      2     p_ty_railroad_operator   IN       ty_railroad_operator,
      3     p_railroad_operator_id   OUT      NUMBER
      4  )
      5  IS
      6     v_railroad_operator_id   NUMBER := 10;
      7  BEGIN
      8     DBMS_OUTPUT.put_line(p_ty_railroad_operator.rrx_railroad_operator_cd);
      9     DBMS_OUTPUT.put_line(p_ty_railroad_operator.rrx_railroad_operator_nm);
     10     DBMS_OUTPUT.put_line(p_ty_railroad_operator.rrx_railroad_operator_dsc);
     11     DBMS_OUTPUT.put_line(p_ty_railroad_operator.status);
     12     DBMS_OUTPUT.put_line(p_ty_railroad_operator.last_update_dt);
     13     DBMS_OUTPUT.put_line(p_ty_railroad_operator.last_update_user);
     14  END;
     15  /
    
    Procedure created.
    
    SQL>
    SQL> DECLARE
      2     v_ty_railroad_operator   ty_railroad_operator
      3        := ty_railroad_operator('OP_CD', 'OP CODE NAME', 'OP CODE DESC', 'S',
      4                                SYSDATE, 'OP CODE USER');
      5     a                        NUMBER(10);
      6  BEGIN
      7     set_railroad_operator(p_ty_railroad_operator => v_ty_railroad_operator,
      8                           p_railroad_operator_id => a);
      9  END;
     10  /
    OP_CD
    OP CODE NAME
    OP CODE DESC
    S
    15-JUN-10
    OP CODE USER
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

Maybe you are looking for