Help in passing array values

Hi,
I have a procedure which accepts in parameter
email_list. this is of type merge_email.
Now merge_email is a record type:
TYPE merge_email_value IS RECORD (
contact_type_id number,
contact_email_id varchar2,
email_address varchar2,
email_priority varchar2
type merge_email is table of merge_email_value ;
i want to test this procedure. how will i pass multiple values to this parameter?
eg:
1'st set of email:
1,2,[email protected],3
2'st set of email:
1,2,[email protected],2
i want to pass these two sets of values at a time to this IN parameter email_list. How can i achieve this?
Thanks for your help
Edited by: user13294597 on Jun 17, 2010 4:53 AM

Hi blueforg,
It is not an SQL type...but a PL type... and karthik had put another proc in the pkg to assign the values...but i suppose it is not possible to assign values from outside the pkg....smthng like you have done...
i tried karthiks approach by defining a similar type outside
eg:
declare
    type t1_temp is record(contact_type_id number,
contact_email_id varchar2(20),
email_address varchar2(20),
email_priority varchar2(10));--same record as defined in PKG.
    t1_temp1 t1_temp:=t1_temp();
begin
t1_temp1.extend();
t1_temp1(1).id1:=1;
t1_temp1(1).id2:=1;
t1_temp1.extend();
t1_temp1(1).id1:=2;
t1_temp1(1).id2:=2;
p_test_pkg.p_test(t1_temp1);
end;--this does not seem to work...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Passing array values to methods & Classes

    Hi,
    I have written the following two classes, I want to pass the value from one class - insersortest to the other class what kind of return statement do I do ? I am not sure what does this Comparable object do in this program ? I am trying the program (algorithm specfieid) from one of the Data Structure book.
    import java.io.*;
    import java.lang.*;
    public class Insersortest
    public static void main(String args[]) throws IOException
    Insersort ghl = new Insersort();
              Comparable a[] = {1, 3, 5, 9, 1};          
                   System.out.println("Detecting duplicates"+ ghl.insertA(a));               
    -=-=-=-
    class Insersort
    public static int insertA( Comparable [ ] a )
    for( int p = 1; p < a.length; p++ )
    Comparable tmp = a[ p ];
    int j = p;
    for( ; j > 0 && tmp.compareTo( a[ j - 1 ] ) < 0; j-- )
    a[ j ] = a[ j - 1 ];
    a[ j ] = tmp;
    Could somebody provide their view please.
    PK

    You return arrays just like any object:
    public Object[] getArray()Comparable is an interface. Any object that implements Comparable (and can therefore be stored in a Comparable's reference) is guarenteed to have a compareTo method.
    Does that help?

  • Passing array values to an Applet from JSP

    Hi,
    I have a JSP page in which I've arrays that are populated from a DB. I want to pass these array values from the JSP page to a Applet in the same page. Is it possible ?
    Any help will be appreciated.
    :-) Praveen

    Then the answer is no. The Applet doesn't exist until it is instanciated by the browser so the JSP running on the server can not pass Java Objects. You can either set up a javascript array, set the parameter tags in the HTML Applet tag or have the Applet open a URLConnection back to the server.

  • Help with passing integer value in A.S.S

    I get an NSinternal script error while trying to pass this value can anyone help?
    Also I wonder if it is possible to pass the value to a matrix
    on clicked theObject
    tell button "checkbox" of window 1
    if integer value = 1 then
    set button "checkbox2" of window 1 to integer value = 1
    else
    set integer value to 0
    end if
    end tell
    end clicked
    I also tried:
    if state of button "checkbox" of window1 is 1 then
    set the state of button "checkbox2" of window1 to 1
    end if
    Message was edited by: Doug Bassett

    I've been following this thread and trying to figure out how to make this work. I was getting inconsistent results or errors with most of the code that has been posted. But I finally got it working... at least on a Leopard machine (not sure if this could have changed between Tiger and Leopard so your mileage may vary).
    What I found was that a checkbox button that's located directly in a window seems to have a state that's equal to 0 when it's unchecked and 1 when it's checked. But a checkbox cell that's contained within a matrix seems to have a state that's set to either _off state_ or _on state_. Trying to set a cell's state to 0 or 1 simply wasn't working right for me. So I get the state of the "selectall" checkbox button (which is a 0/1) and transform it to either "off state" or "on state" before setting the states of the checkbox cells in the matrix.
    Here's my code:
    on clicked theObject
    set n to name of theObject
    if n = "selectall" then
    set s to state of theObject
    log "state: " & s
    if s = 0 then
    set newState to off state
    else
    set newState to on state
    end if
    repeat with i from 1 to count of cells of matrix "directories" of window "main"
    tell cell i of matrix "directories" of window "main"
    set state to newState
    end tell
    end repeat
    return
    end if
    if n = "logStatesBtn" then
    logStates()
    return
    end if
    end clicked
    on logStates()
    log "Logging states:"
    set s to state of button "selectall" of window "main"
    log "selectall checkbox: " & s
    repeat with i from 1 to count of cells of matrix "directories" of window "main"
    tell cell i of matrix "directories" of window "main"
    set s to state
    end tell
    log "Cell " & i & ": " & s
    end repeat
    end logStates
    Note the "logStates" handler is just something I connected up to a "logStatesBtn" button in my window that lets me spit out the states of all the checkboxes into the console log. This is how I actually discovered that the cells were set to "off state" or "on state".
    Steve

  • Help with getting array values from a file

    Hey ppl. Im doing a programming assignment just now and im completely stumped. I know i can ask my tutor but that will take a week (he is never in) so i was wondering if any of you could help. The basic idea is that you have to store numbers read from a file into an array. The catch is that you are not given the size of the array, you have to discover this by counting the numbers in the file. It terminates when -1 is discovered. This 'count' then states the size of the array.
    I got this done ok and i thought I was on easy street after that. All i had to do was read the numbers into the array but alas its not working. The compiler gives it the ok, but when i run the program i get the following error
    Exception in thread "main" java.lang.nullPointerException
    at marks.main(marks.java:48)
    By the way line 48 is as follows
    numbers[index] = Integer.parseInt(infile.readLine().trim());
    and here is the evil program!!!!!
    //Paul Rodger ***MARKS*** 14/1/02
    //A program which takes numbers from a file and enters them into an array.
    //The stream of numbers is terminated when the number -1 is discovered
    import java.io.*;
    class marks
    static BufferedReader keyboard = new
    BufferedReader(new InputStreamReader(System.in));
    static PrintWriter screen = new PrintWriter(System.out, true);
    static public void main(String[] args) throws IOException{
    FileReader file = new FileReader("numbers.txt");
    BufferedReader infile = new BufferedReader(file);
    //local Data
    int COUNT;
    double x;
    char ans;
    COUNT=0; // initialising the counter
    //inputs values and calculates the sum
    x = Double.parseDouble(infile.readLine().trim());
    while (x>=0){
    COUNT++;
    x= Double.parseDouble(infile.readLine().trim());
    // display the count
    screen.println("the number of values entered was : " +COUNT );
    // stores numbers in the array
    int[] numbers = new int[COUNT];
    for(int index=0 ; index < COUNT; index++)
    numbers[index] = Integer.parseInt(infile.readLine().trim());
    infile.close();
    Any help is appreciated!

    What was suggested is this -
    prior to this line ...
    int[] numbers = new int[COUNT];insert these lines ...
    file = new FileReader("numbers.txt");
    infile = new BufferedReader(file);An alternative solution, one which reads the file only once, is to do it this way ...
    1. read the numbers and put them into a List (either ArrayList or Vector)
    2. instantiate the array based on the size of List (list.size())
    3. populate the array from the list

  • Help posting correct Array[value] to JSP page

    Hello,
    Can someone please tell me what is wrong with this? I am posting the following page (only a portion of the page is listed below) to another jsp page. It consists of a listing of books for sale. Next to each book is a separate "add to cart" button. I want to send the corresponding "isbn" (indexed in an Array) to the next page. When I add print stmts for each record, I can see that the correct isbn is attached to each book.
    The problem is that when I post this to the next page, the formparm for isbn is always the 1st isbn in the array, instead of the selecgtedIsbn. Why???
    Thanks in advance!
    <CODE>
    <% for(int i=0; i < isbnValues.length; i++) {  %> 
    <TABLE>
    <% if ( isbnValues[i] != null) { %>   
    <tr>
    <td> <B><%= titleValues[i] %> </B> </td>     
    <INPUT TYPE="HIDDEN" NAME="selectedIsbn" VALUE="<%= isbnValues[i] %> "></INPUT>
    <INPUT TYPE="HIDDEN" NAME="selectedPrice" VALUE="<%= priceValues[i] %> "></INPUT>
    <td align="right"> <i>Price: </i>
         <%      DecimalFormat df = new DecimalFormat("$#,##0.00");
              String strPrice = df.format(Double.parseDouble(priceValues));
         %>
              <%= strPrice %>     <br>
    </td>
    <td align="right"><i>Quantity:</i>      
         <INPUT TYPE="TEXT" NAME="qty" VALUE="1"></INPUT> <br> </td>
    <td align="right">
         <INPUT TYPE="SUBMIT" VALUE="Add to Shopping Cart"></INPUT> <br>
    </td>
    </tr>
    <% } %>     <%-- end if isbn --%>     
    </TABLE>
    <% } %> <%-- end for loop --%>     
    </CODE>

    Hi,
    I have the indexes, but they were somehow removed when I posted the code. I used the wrong tags.
    I used the right tag and added spaces around the [" i "].
    Let's try again... Here's the code:
    <% for(int i=0; i < isbnValues.length; i++) {  %> 
    <TABLE>    
    <% if ( isbnValues[ i ] != null) { %>   
    <tr>
    <td>  <B><%= titleValues[ i ]  %> </B> </td>     
    <INPUT TYPE="HIDDEN" NAME="selectedIsbn" VALUE="<%= isbnValues[ i ] %> "></INPUT>
    <INPUT TYPE="HIDDEN" NAME="selectedPrice" VALUE="<%= priceValues[ i ] %> "></INPUT>
    <td align="right">  <i>Price: </i>
         <%      DecimalFormat df = new DecimalFormat("$#,##0.00");
              String strPrice = df.format(Double.parseDouble(priceValues[ i ]));
         %>  
              <%= strPrice %>     <br>
    </td>
    <td align="right"><i>Quantity:</i>                 
         <INPUT TYPE="TEXT" NAME="qty" VALUE="1"></INPUT>   <br> </td> 
    <td align="right">
         <INPUT TYPE="SUBMIT" VALUE="Add to Shopping Cart"></INPUT> <br>
    </td>
    </tr>
    <% } %>     <%-- end if isbn  --%>     
    </TABLE>
    <% } %>      <%-- end for loop  --%>     

  • URGENT: Passing Array from JSP to a Stored Procedure

    Hi,
    Can some one please help me understanding how can I pass array from JSP page to a stored procedure in database.
    Thanks in advance.
    Jatinder

    Thanks.
    I tried ArrayExampla.java and was successful in passing array values to the stored database procedure.
    How can I use this class in JSP? Like I have first JSP where in I will collect input from the user and then submit it to the second JSP - that needs to call the ArrayExample.java to pass the values as array to the database.
    How should I call this java code in my second JSP?
    Thanks in advance.

  • Help Creating A Link In An IR Report Passing The Value From A Different Col

    Version 4.0.2.00.07
    Hello,
    I have an Interactive Report with a column that I need to create a link on but I need to pass the value of another column.
    This report shows the Features of a particular Release. There is a select list for the Release that is selected and executes the report.
    There is a column that indicates whether the Feature has a Commitment attached to it. If there is have that a link to another report that shows all the Commitments for that Feature by passing the FEATURE_ID which is also a column on the Feature report.
    Query:
    SELECT
          ,CASE WHEN ft.feature_id IN (SELECT cc.feature_id
                                       FROM customer_commitments cc
                                       WHERE ft.feature_id = cc.feature_id
                                      ) THEN 'Yes' ELSE 'No'
           END "Commitment Exists"
              ,ft.feature_id
    FROM ....If "Commitment Exists" has a 'Yes', the 'Yes' is a link that will pass the FEATURE_ID to another report that will show the Commitments for that Feature. If the "Commitment Exists" has a 'No' then no link.
    I was also wondering if the Commitment report could open in a seperate window and make it modal?
    I hope this is clear and someone could help me.
    Please let me know if it's not clear or more information is needed.
    Thanks,
    Joe

    To accomplish this I would build the link as part of the value. So if Yes the Yes itself would be a link, if No is simply text as today.
    It would look something like this:
    SELECT
          ,CASE WHEN ft.feature_id IN (SELECT cc.feature_id
                                       FROM customer_commitments cc
                                       WHERE ft.feature_id = cc.feature_id
           THEN
            '<a href="f?p=&APP_ID.:NEW_PAGE:&SESSION.::::Pn_FEATURE_ID:' || ft.feature_id || '">Yes</a>'
           ELSE
            'No'
           END "Commitment Exists"
              ,ft.feature_id
    FROM ....One problem with this approach is when you export the report (as a CSV for example). There are a few ways to handle this, one is to simply duplicate the column with clear text yes and no and set this column to be included on export and only visible on export. The other column, with the link, set it to no export.
    The other option is to add another condition on the REQUEST value.
    SELECT
          ,CASE WHEN ft.feature_id IN (SELECT cc.feature_id
                                       FROM customer_commitments cc
                                       WHERE ft.feature_id = cc.feature_id
           THEN
                  decode(:REQUEST, 'CSV', 'Yes'
                , '<a href="f?p=&APP_ID.:NEW_PAGE:&SESSION.::::Pn_FEATURE_ID:' || ft.feature_id || '">Yes</a>'
           ELSE
            'No'
           END "Commitment Exists"
              ,ft.feature_id
    FROM ....It seems that the link itself is getting replaced with a #. The link would look something like this:
    'f?p=&APP_ID.:NEW_PAGE:&SESSION.::::Pn_FEATURE_ID:' || ft.feature_id
    Hope this helps.
    Oh and of course, in order for the link to display you need to change the Display Type to "Standard Report Column" otherwise the HTML will be escaped.
    Thanks
    -Jorge

  • Dynamically passing the values to search help

    hi
    can I pass some values dynamically to search help input field.
    If I select a profit centre value from a drop down in separate field it should reflect the corresponding values in
    search help which is cost centre input field ( i/p fields is in a column of a UI element table).
    If I add one more row also the corresponding column should bears the search help...
    thanx in advance.......

    Data dictionary based search helps can have multiple importing parameters within Web Dynpro.  There are few rules that are documented in the online help however:
    Be aware that import and export parameters for the search help are determined only within the same context node (see also Transport of Values for the Input Help), and even then only if a Dictionary structure is assigned to the node.
    http://help.sap.com/saphelp_nw70/helpdata/EN/35/bdb6e2c48411d1950800a0c929b3c3/frameset.htm

  • Problem with prepared statement where cluase when passing string value.Help

    I am updating a table using the following code. I am using string parameter in where clause. if I use Long parameter in where clause with ps.setLong , this code is working. Is there any special way to pass string value? Am I doing anything wrong?
    ===================
    updateMPSQL.append("UPDATE MP_Table SET ");
         updateMPSQL.append("MPRqmt = ?,End_Dt = ? ");
              updateMPSQL.append("where POS = ? ");
              System.out.println(updateMPSQL.toString());
              con     = getConnection(false) ;
              ps      = con.prepareStatement(updateMPSQL.toString());
              ps.setLong(1,MPB.getMPRqmt());
              ps.setDate(2,MPB.getEnd_Dt());
              ps.setString(3,MPB.getPos());
    result = ps.execute();
              System.out.println("Result : " + result);
    ==========
    Please help me.
    Thanks in advance.
    Regards,
    Sekhar

    doesn't Pos look like a number rather than a string variable?
    if I use Long
    parameter in where clause with ps.setLong , this code
    is working.
    updateMPSQL.append("where POS = ? ");
    ps.setString(3,MPB.getPos());

  • Help on passing value

    Hi all
    I want to pass a value from program A to program B. However it not working, please help if u see any mistake in the code below. Many thanks!!!
    do this and see. create 2 programs like this
    REPORT ztest_gopi. " ZTEST_GOPI
    PARAMETERS : p_c(3) TYPE c.
    START-OF-SELECTION.
      EXPORT p_c TO MEMORY ID 'MID'.
    " Report 2
    REPORT ztest_gopi1. " ZTEST_GOPI1
    PARAMETERS : p_c(3) TYPE c.
    INITIALIZATION.
      IMPORT p_c FROM MEMORY ID 'MID'.

    Below is my code. I tested is not work. Please help me to see any error.
    The bold text is my unsure sytnax.
    REPORT  ZGARY_PASS1.
    TABLES tvarvc.
    PARAMETERS : p_c(3) TYPE c.
    <b>DATA: wa_tvarvc TYPE tvarvc.</b>
    select single *
    into wa_tvarvc
    from tvarvc
    where NAME = sy-repid and
    type = 'P' and
    numb = '0000'.
    if sy-subrc eq 0.
    Record already exist, so modify record
    wa_tvarvc-low = p_c.
    modify tvarvc from wa_tvarvc.
    if sy-subrc eq 0.
    commit work.
    endif.
    else.
    Record doe snot exist, so add record
    wa_tvarvc-low = p_c.
    insert tvarvc from wa_tvarvc.
    if sy-subrc eq 0.
    commit work.
    endif.
    endif.
    REPORT  ZGARY_PASS2.
    TABLES tvarvc.
    PARAMETERS : p_c(3) TYPE c.
    <b>DATA: wa_tvarvc TYPE tvarvc.</b>
    select single *
    into wa_tvarvc
    from tvarvc
    where NAME = 'ZGARY_PASS1' and
    type = 'P' and
    numb = '0000'.
    if sy-subrc eq 0.
    *Assign wa_tvarvc-low to your desired parameter.
    <b>p_c = wa_tvarvc-low.</b>
    endif.

  • Pass array of value to Oracle Java Beans (for forms)

    Hi,
    How I can pass a array value from oracle Form to Java bean.
    With regards
    Satheesh Kumar

    Hi,
    Thanks for your immediate response.
    I have one more doubt. I am trying to create a Hirachical tree for form using Jtree. For dynmically populating tree data I want to pass array records from oracle forms.
    In my understanding, Java importer array will work if we do importing the java beans component to oracle forms, otherwise no.
    Is it possible I can pass array variable with out importing my javacomponent.
    With regards

  • Arrays pass by value

    hi guys
    are primative arrays passed by value or passed by reference
    cheers
    spob

    Java uses pass by value. The references to the arrays
    are passed by value, though of course a copy of a
    reference refers to the same thing as the "original"
    reference does.I hope you got the support one!
    This is an automatically generated Delivery Status Notification.
    Delivery to the following recipients failed.
    [email protected]
    [email protected]

  • Help in passing value to next .asp page

    Hi all, i need help on this problem. i want to pass the value of tag_num and platform to the detail.asp, somehow it give me error. below are my code and screenshot.
    <%
    While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
    %>
          <tr>
            <td height="50" bgcolor="#FFFFFF"><span class="style2"><%=(Recordset1.Fields.Item("tag_num").Value)%></span></td>
            <td height="50" bgcolor="#FFFFFF"><span class="style2"><%=(Recordset1.Fields.Item("platform").Value)%></span></td>
            <td width="205" bgcolor="#FFFFFF"><span class="style2"><%=(Recordset1.Fields.Item("system").Value)%></span></td>
            <td width="41" bgcolor="#FFFFFF"><a HREF="detail.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "tag_num=" & Recordset1.Fields.Item("tag_num").Value & "platform=" & Recordset1.Fields.Item("platform").Value %>">VIEW</a></td>
          </tr>
          <%
      Repeat1__index=Repeat1__index+1
      Repeat1__numRows=Repeat1__numRows-1
      Recordset1.MoveNext()
    Wend
    %>
    "part of detail.asp code to receive the value"
    <%
    Dim Recordset1__MMColParam
    Recordset1__MMColParam = "1"
    If (Request.QueryString("tag_num") <> "") Then
      Recordset1__MMColParam = Request.QueryString("tag_num")
    End If
    %>
    <%
    Dim Recordset1__MMColParam2
    Recordset1__MMColParam2 = "1"
    If (Request.QueryString("platform") <> "") Then
      Recordset1__MMColParam2 = Request.QueryString("platform")
    End If
    %>
    <%
    Dim Recordset1
    Dim Recordset1_cmd
    Dim Recordset1_numRows
    Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
    Recordset1_cmd.ActiveConnection = MM_InstrumentDB_STRING
    Recordset1_cmd.CommandText = "SELECT * FROM Instrument_baram WHERE tag_num = ? AND platform = ?"
    Recordset1_cmd.Prepared = true
    Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1", 200, 1, 255, Recordset1__MMColParam) ' adVarChar
    Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param2", 200, 1, 255, Recordset1__MMColParam2)
    Set Recordset1 = Recordset1_cmd.Execute
    Recordset1_numRows = 0
    %>
    to display the dable, this is my code
    <table width="450" border="1" cellspacing="0" bordercolor="#FF6600" bgcolor="#1941A5">
          <tr>
          <th style="background-color:#CEC49D" height="35" scope="row"><span class="style2">TAG NUMBER</span></th>
            <td bgcolor="#FFFFFF"><span class="style2"><%=(Recordset1.Fields.Item("tag_num").Value)%></span></td>
        </tr>
          <tr>
          <th style="background-color:#CEC49D" width="200" height="35" scope="row"><span class="style2">PLATFORM</span></th>
          <td width="356" bgcolor="#FFFFFF"><span class="style2"><%=(Recordset1.Fields.Item("platform").Value)%></span></td>
        </tr>
        <tr>
          <th style="background-color:#CEC49D" height="35" scope="row"><span class="style2">TYPE OF SYSTEM</span></th>
          <td bgcolor="#FFFFFF"><span class="style2"><%=(Recordset1.Fields.Item("system").Value)%></span></td>
        </tr>
    it give me this error
    Please somebody help me. Thanks in advance.
    Regards,
    Zuma.

    yup. my page connected to the server. if i pass "tag_num" value only, it will give me no error. the output is there. but the things is i need to pass "platform" value.
    sample of my database structure is
    Instrument_baram
    tag_num platform field system
    AGSC_503
    BNP-C
    BARONIA
    PMCS
    AGSC_503
    BNP-B
    BARONIA
    PMCS
    TAG NUMBER
    TYPE OF INSTRUMENT
    SYSTEM
    PLATFORM
    AGSC_503
    Limit switch
    PMCS
    BNP-C
    View
    AGSC_503
    Limit switch
    PMCS
    BNP-B
    View
    if i pass "tag_num" value only, it will select AGSC_503 platform BNP-C only eventhough i click on AGSC_503 platform BNP-B "View".
    that why i need to pass the "platform" value

  • Help with passing values to methods

      GregorianCalendar baseTime = new GregorianCalendar();
      long baseSystemTime = System.currentTimeMillis();
      // After some iterations I want to update the
      // calendar to reflect the current time.
      // I do not want to go through instantiating a new calendar
      baseTime = updateTimestamp(baseTime,baseSystemTime);
      private static GregorianCalendar updateTimestamp(GregorianCalendar GC, long lastTime){
        // This gets the difference between the last time check and now.
        // It then adds that difference to the calendar and returns the updated
        // calendar.
        int msDifference =
          new Long(System.currentTimeMillis() - lastTime).intValue();
        GC.add(GregorianCalendar.MILLISECOND,msDifference);
        lastTime = new Long(System.currentTimeMillis()).longValue();
        return GC;
      }The problem is that the lastTime variable that it passed gets updated to the current MS value. But, the original baseSystemTime never changes.
    I thought that if you pass something to a method and it gets altered in the method the original object is updated. Am I wrong?

    So objects are passed by reference but primitives are
    passed by value?Simply speaking: Yes.
    Strictly speaking: No. Every parameter is passed by value because Object obj IS a reference. So when you do call(myObject), you are passing the value of the reference of the object (the adress of the object).

Maybe you are looking for