help in passing the values in the table

Hello
I have a procedure that accepts as a parameter
email_list. It is the type merge_email.

Merge_email is now a record type:
TYPE merge_email_value () IS RENDERING
number of contact_type_id
contact_email_id varchar2,
Email_Address varchar2,
email_priority varchar2
);
type merge_email is table of the merge_email_value;

I want to test this procedure. How to pass multiple values for this setting?

for example:
1' st set of E-mail:
1, 2, [email protected], 3
2' st set of E-mail:
1, 2, [email protected], 2

I would like to pass these two sets of values both to this parameter IN email_list. How can I achieve this?

Thanks for your help

Published by: user13294597 on June 17, 2010 04:53

You want something like that

create or replace package my_pkg
as
  type merge_email_value is record (
                               contact_type_id number,
                               contact_email_id varchar2(100),
                               email_address varchar2(100),
                               email_priority varchar2(100)
                                   );

  type email_list is table of merge_email_value;

  procedure my_test_procedure(pEmailList in email_list);
  procedure run_procedure;
end;
/
create or replace package body my_pkg
as
  procedure my_test_procedure(pEmailList in email_list)
  is
  begin
    for i in 1..pEmailList.count
    loop
      dbms_output.put_line(pEmailList(i).contact_type_id || '/' ||
                               pEmailList(i).contact_email_id || '/' ||
                               pEmailList(i).email_address || '/' ||
                               pEmailList(i).email_priority);
    end loop;
  end;

  procedure run_procedure
  is
    lEmailList email_list := email_list();
  begin
    lEmailList.extend;
    lEmailList(1).contact_type_id := 1;
    lEmailList(1).contact_email_id := '2';
    lEmailList(1).email_address := '[email protected]';
    lEmailList(1).email_priority := '2';

    lEmailList.extend;
    lEmailList(2).contact_type_id := 1;
    lEmailList(2).contact_email_id := '2';
    lEmailList(2).email_address := '[email protected]';
    lEmailList(2).email_priority := '3';

    my_test_procedure(lEmailList);
  end;
end;
/
begin
  my_pkg.run_procedure;
end;
/

Tags: Database

Similar Questions

  • Help setting up the table/list of choices

    Hello:

    I create an application where I use a custom authentication scheme and captures all user information in a separate table. When the user logs in he will refer to the table to identify a user name and password stored in the table.

    I am allowing users to create their own user accounts that will be default to basic access levels. Further along in the process, users will need to select a person to approve something. I want to use a list of choices so that the name of the approver is entered regularly every time. The user table has the following format:

    Default primary key Type Nullable data column name
    Username VARCHAR2 (8) No - 1
    PASSWORD VARCHAR2 (8) No. -
    FNAME VARCHAR2 (30) - No.
    LNAME VARCHAR2 (30) - No.
    E-MAIL VARCHAR2 (50) - No.
    ADMIN VARCHAR2 (1) Yes.
    APPROVER VARCHAR2 (1) Yes.


    I would like users to be able to choose from a list of choices that displays LNAME, FNAME. I don't know how to make the two fields appear in a list of choices.

    Furthermore, I would like to (if possible) to keep the two separate fields for the creation of user accounts so that I can get a coherent LNAME, FNAME format and people are not go backwards (e.g., Smith, Joe c. Joe Smith).

    If I can't show the two fields in the drop-down list, is there a way where I could add a free calculation filed to the table that will concatenate LNAME"," FNAME?

    Thanks for any help you can provide.

    RKD,

    Create a dynamic list of values.

    select lname||', '||fname displayed, username returned
    from user
    order by 1
    

    You can view what you want, regardless of the value returned. And that includes the concatenation of elements together (or do other calculations/manipulations).

    -David

  • Help needed in the table in the Table using the OPS approach

    We have a requirement in the OPS in which the region of the page of search results should provide details of the header. And in the header Details there is a show and hide the button that would show details of line corresponding to the header (such as the Table - to - Table).



    For more details header I used table under the tip, I used region of detail and there I created the table for more details of line.

    I also created see links in the header details links discovers the object and a view object Details.



    I put in the request of the controller process method, see link name and name of the child attribute for external table (table details header) and the inner table (line details table)



    When I launch OAF page, I get the error below. I am facing this error when I tried to put the link name view attribute and child of the internal table (i.e. table line details) in the controller.

    Retail 0 #.
    java.lang.NullPointerException
    at oracle.apps.fnd.framework.webui.OAAdvancedTableHelper.updateInnerTableProperties (unknown Source)
    at oracle.apps.fnd.framework.webui.OAAdvancedTableHelper.processRequestAfterController (unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest (unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanTableHelper.processRequest (unknown Source)
    at oracle.apps.fnd.framework.webui.OAAdvancedTableHelper.processRequest (unknown Source)
    at oracle.apps.fnd.framework.webui.beans.table.OAAdvancedTableBean.processRequest (unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren (unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren (unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest (unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest (unknown Source)
    at oracle.apps.fnd.framework.webui.beans.layout.OAFlowLayoutBean.processRequest (unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren (unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren (unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest (unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanTableHelper.processRequest (unknown Source)

    User - try the framework OFA Forum

  • Passing a value from one table to another

    Access database:
    I have 2 tables, table 1 has a field that is a primary key (not indexed, no dups), table 2 has a field that should receive the same number as the table represented in 1.
    The problem is that when the query runs, it gets the MAX (number), but when it is inserted in table 2, all records in table 2 are updated with this number.
    Is there a way to prevent all the records in a table 2 updated and only the most recent file receiving the number in table 1?
    Any ideas?

    This is my query:

    < cftransaction >

    < cfif len (trim (form. GT Time_Spent)) 0 >
    < cfquery "InsertRecord' datasource = name ="NBProdReports">
    Insert Into TblMasterTrans (Time_Spent) Values ('#form.) Time_Spent #')
    < / cfquery >
    < / cfif >

    < cfif len (trim (form. WG Notes)) 0 >
    < cfquery "InsertRecord' datasource = name ="NBProdReports">
    Insert into TblContractInfo_SubMenuTable (Contract_Number, Transaction_Type, Num_Checks_Trans, Notes)
    Values ('#form.) Contract_Number # ',' #form. Trans_Type # ',' #form. Num_Checks_Trans # ',' #form. Notes #')
    < / cfquery >
    < / cfif >

    < name cfquery = "getTask_Number" datasource = "NBProdReports" >
    SELECT MAX (Task_Number) AS theTask_Number
    Of TblMasterTrans
    < / cfquery >

    < name cfquery = "SetTaskNumber" datasource = "NBProdReports" >
    Update TblContractInfo_SubMenuTable
    Set
    Task_Number = #getTask_Number.theTask_Number #.
    Where Task_Number = Null
    < / cfquery >

    < / cftransaction >

    In fact, you could even with impunity with a single query by selecting the Task_Number MAX in the second insert statement.



    Insert Into TblMasterTrans (Time_Spent) Values ('#form.) Time_Spent #')



    Insert into TblContractInfo_SubMenuTable (Task_Number, Contract_Number,
    Transaction_Type, Num_Checks_Trans, Notes)
    SELECT MAX (Task_Number), ' #form. Contract_Number #'.
    ' #form. Trans_Type # ',' #form. Num_Checks_Trans # ',' #form. Note #'
    Of TblMasterTrans

    Phil

  • Can someone help me with the table layout please

    www.hunterstables.co.UK/pricelist1.html

    I am trying to create a table with an ordered list in my table.

    I have three rows and three columns. The first is my 'specifications' title that is correct.  The second row, I would like to have the titles of the product in bold, but as in the 'td' If make sure that "BOLD" then all the text will be "BOLD".

    My third row, trying to get my products in a list, so IE

    3 X 2 CLS TANALISED FRAMING

    4 X 2 TANALISED PERLINS TANALISED

    FINISHES of RABBETS of T & G 16MM, 12MM

    PROFILE BOX GALVANIZED STEEL ROOF

    2PI OVERLOOK STANDARD WITH SHED ROOF

    Can someone please!

    Thank you in advance.

    Copy and paste the css code and table:

    Specification table

    SPECIFICATIONS
    BUDGET

    16mm T & G rabbets, ends 12mm (treated)

    STANDARD


    19mm T & G rabbets, finishes 15mm (treated)

    PREMIUM


    22mm T & G rabbets, ends 19mm (treated)

    • 3 x 2 CLS Tanalised framing
    • 4 x 2 Tanalised Perlins Tanalised
    • 16mm T & G rabbets, ends 12mm
    • 2 pi in standard with shed roof overhang

    • 3 x 2 CLS Tanalised framing
    • 4 x 2 Tanalised Perlins Tanalised
    • 16mm T & G rabbets, ends 12mm
    • 2 pi in standard with shed roof overhang

    • 3 x 2 CLS Tanalised framing
    • 4 x 2 Tanalised Perlins Tanalised
    • 16mm T & G rabbets, ends 12mm
    • 2 pi in standard with shed roof overhang

  • Need help to replace the tables with CSS

    Having trouble finding how to recreate these stacked boxes:

    http://96.0.181.107/_report-containers.html

    like div using only CSS, keeping the same look/padding.

    I want to close the space between the containers by a few pixels, that I can't do with tables and use the simplest code possible.

    Thank you!

    Try this (view source to see the code)

    http://ALT-Web.com/test/boxes.html

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    http://ALT-Web.com/
    http://Twitter.com/ALTWEB

  • 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

  • disorder affecting the values in the table according to cfscript

    I try to pass an array to a function, cfscript and assigning values to it. When I see if the value has been assigned to the right, I get an error saying I'm trying to dereference a scalar.

    function g (q, recsq, arr) / / q is a query name, recsq is the number of lines in q, arr is an array name

    {

    evaluate (arr &'[1] [1] ='& q &'.code [1]');
    WriteOutput(a[1][1]);
    }
    g('qpr','#recsqpr#','apr');

    The allocation already works if I don't mean to call a function, but I would like to know what I'm doing wrong.

    This "disorder" have you passing the table in?

    There is no difference in passing an array as a parameter of function in any other kind of data type:

    myArray = arrayNew();
    myArray [1] = 'something ';
    myArray [2] = "something";

    myArray = myFunction (myArray);

    writeOutput ("here is the new value: #myArray [3] #");

    Function myFunction (someArray) {}
    arrayAppend (someArray, 'new value');
       
    return untableau;
    }

    Do you understand how everything works?

    --

    Adam

  • Droping a table from within a procedure by passing the name of the Table as an Argument

    HII All

    I want to remove a table from a procedure dynamically passing the table name as a parameter of a procedure manual

    to do this, I wrote the following procedure

    CREATE OR REPLACE PROCEDURE DEL_TAB (TAB_NAME IN VARCHAR2) AS

    V_TAB_NAME VARCHAR2 (10);

    V_STMT VARCHAR2 (50);

    BEGIN

    V_TAB_NAME: = TABLE_NAME;

    V_STMT: = 'DROP TABLE' | V_TAB_NAME;

    RUN IMMEDIATELY 'V_STMT ';

    DBMS_OUTPUT. PUT_LINE(V_TAB_NAME||) e TABLE DELETED ');

    END DEL_TAB;

    but whenever I'm execute it gives me an error

    ERROR on line 1:

    ORA-06550: line 1, column 15:

    PLS-00357: Table, view or sequence of reference 'A' not allowed in this context

    ORA-06550: line 1, column 7:

    PL/SQL: Statement ignored

    Please tell me the solution...

    Thanks in advance

    Alisson

    Why do you want to implement this procedure? If you want to remove a table just issue the DROP of stand-alone statement. Why write a procedure for this? Also you must understand the difference between REMOVE and DROP in the context of RDBMS. You either use them which is incorrect. DELETION is to remove rows from a table and DROP is to remove the database table.

    And with regard to your problem

    > RUN IMMEDIATELY 'V_STMT ';

    This should be

    immediately run v_stmt;

    You closed the V_STMT variable is in single quotes. You must remove the apostrophes.

  • remove items from the table and resize the matrix

    Hello, I'm new to Labview so I'm struggling with ideas. I have the following matrix

    A = [1 2 3 4

    5 6 7 8

    9 10 11 12

    13 14 15 16]

    I want to get only follows resized in a matrix with items 6, 7, 10 and 11, that is

    B = [6 7

    10 11]

    I appreciate your help

    On the table-online matrix palette, there is a function to get a submatrix.

  • Create the Table as and hybrid columnar Compression

    I'm looking to connect to tables help to create the table as I had a question about columnar Compression hybrid. For the test, I found that the uncompressed daata will be approximately 10 to and compressed data will be around 1 TB. I anticipate compress the table when the table to create as an instruction and wanted to know in what order Oracle forge do compression, that is, the table will be created then Oracle will compress the data or will the compressed table that the table will be created. The motivation behind the question is to see how much storage I need to complete the operation.

    Thank you

    If you are using
    create table xxx compress for query high what to choose...

    While the data will be compressed before insertion, so in your case, it will use about 1 TB of disk space

  • How to pass the value to query LOV of rows in the table.

    simple table on the page of the ofa:

    col1 col2
    ABC lov-activated
    PQR lov-people with disabilities
    MNO lov-activated

    Col2 is lov and turned under condition if it meets certain conditions. I am capable of until.
    How to pass values in col1 to the co of lov lov query?

    Help, please
    Thank you

    Hello

    You can pass the value to LOV in this way in a region of the table.

    col1 col2

    DEPTNO empname (Lov field)
    1 lov1
    2 lov2

    requirement: lov1, you will need to pass the value of deptno 1.

    If deptno is message style text then you need to create a value of the deptnoFormValue with the attribute in the base page table area, and the same instance of vo.

    danslechamp empname lov

    fields of lov region:

    EmpName,
    DEPTNO,
    and deptnoFormValueinLov

    lov mappings: a first return to the basic page.

    a second part of the criteria

    Point lov region: deptnoFormValueinLov
    Return article: -.
    Point of criteria: deptnoFormValue
    Required: true
    Query programmatically: true

    Now create a controller for the region of Lov

    the code example is:

    Import oracle.apps.fnd.framework.OAApplicationModule;
    Import oracle.apps.fnd.framework.OAViewObject;
    java.util.Dictionary import;

    in the process request:

    OAApplicationModule m = pageContext.getApplicationModule (webBean) (OAApplicationModule);
    Dictionary passiveCriteria = pageContext.getLovCriteriaItems ();
    String deptno = (String) passiveCriteria.get ("deptnoFormValueinLov");

    System.out.println ("org code in controller of lov is" + orgcode);

    OAViewObject vo = (OAViewObject) am.findViewObject ("view instance of lov");
    vo.setWhereClause ("Organization_code =" "+ deptno +" ' "");

    System.out.println ("request after adding where clause." + vo.getQuery ());

    hope this is useful

    Kind regards
    Barros.
    [email protected]

  • Need help to build the query/pl-sql block to get the query result and the name of column from DB table in the form of key-value pairs.

    Hi Experts,

    I have a DB table has columns of more than 50.

    I question this table, it should only return one line at any time. as sqldeveloper below image.

    here, I need to build block pl/sql-query, Discover the column in the table as a key and query result as values.

    Eg:     Key                         -  Value

    TASK_EVENT_ID - 1765

    EVENT_TYPE - ASR_UPDATE

    ... etc until all of the columns in my table.

    Experts please comment on that point, appreciate your help on this.

    Thank you

    -Vincent.

    Here is an approach using DBMS_SQL to iterate over the columns of key / value to assign... (Little code snipped for brevity)

    create or replace procedure (task_expired)

    v_store_id in full,

    v_task_action_id in full,

    v_job_id in full

    )

    as

    -[SNIP code...]

    v_sql VARCHAR2 (4000): = ' select * from my_table where PK = 123';  -Your SQL here!

    v_v_val VARCHAR2 (4000);

    v_n_val NUMBER;

    v_d_val DATE;

    v_ret NUMBER;

    c NUMBER;

    d NUMBER;

    col_cnt INTEGER.

    f BOOLEAN;

    rec_tab DBMS_SQL. DESC_TAB;

    col_num NUMBER;

    vAsString VARCHAR2 (4000);

    BEGIN

    -[SNIP code...]

    Message_properties. CORRELATION: = "EDF_EVENT";

    MSG: = SYS. AQ$ _JMS_BYTES_MESSAGE. Construct();

    Msg.set_string_property ('queueName', ' shipping/csi_cth');

    Msg.set_string_property ('MODE', 'CR8');

    c: = DBMS_SQL. OPEN_CURSOR;

    DBMS_SQL. PARSE (c, v_sql, DBMS_SQL. NATIVE);

    d: = DBMS_SQL. Execute (c);

    DBMS_SQL. DESCRIBE_COLUMNS (c, col_cnt, rec_tab);

    1.col_cnt J

    LOOP

    CASE rec_tab (j) .col_type

    WHEN 2 THEN

    DBMS_SQL. DEFINE_COLUMN (c, j, v_n_val);      -Number

    WHEN 12 CAN

    DBMS_SQL. DEFINE_COLUMN (c, j, v_d_val);      -Date

    ON THE OTHER

    DBMS_SQL. DEFINE_COLUMN (c, j, v_v_val, 2000);   -Else treat as varchar2

    END CASE;

    END LOOP;

    LOOP

    v_ret: = DBMS_SQL. FETCH_ROWS (c);

    WHEN OUTPUT v_ret = 0;

    1.col_cnt J

    LOOP

    -Fetch each column to the correct data type based on coltype

    CASE rec_tab (j) .col_type

    WHEN 2 THEN

    DBMS_SQL. COLUMN_VALUE (c, j, v_n_val);

    vAsString: = to_char (v_n_val);

    WHEN 12 CAN

    DBMS_SQL. COLUMN_VALUE (c, j, v_d_val);

    vAsString: = to_char (v_d_val, ' DD/MM/YYYY HH24:MI:SS');

    ON THE OTHER

    DBMS_SQL. COLUMN_VALUE (c, j, v_v_val);

    vAsString: = v_v_val;

    END CASE;

    Msg.set_string_property (rec_tab (j) .col_name, vAsString);

    END LOOP;

    END LOOP;

    DBMS_SQL. CLOSE_CURSOR (c);

    DBMS_AQ. ENQUEUE (queue_name-online 'cbus.aqjms_common',

    Enqueue_options => Enqueue_options,

    Message_properties => Message_properties,

    Payload-online msg,

    Msgid => Message_handle);

    dbms_output.put_line ('00 Msgid =' |) Message_handle);

    dbms_output.put_line('===Done=');

    -[SNIP code...]

    END;

    /

  • Oracle apex 5.0: pass values from one page to the other as well save you can save same value in the table.

    I use oracle apex 5.0

    Issues related to the:

    (1) I created an application where I have a form on which I have a button named 'Add', now if I click on that button values need to be stored in table.how to create! I use the dynamic button that is created by the html tag < input type = "button" > need help with this.

    (2) if the value stored in the table how the same value will be on the agenda of the calling page. ?

    New to this world of Apex.

    concerning

    Pranav shah

    http://zderadicka.EU/Apex-dynamic-actions-with-report-region/

  • Help! multi select values in the table

    Hi gurus,

    Can anyone help me please with this.

    Scenario:
    I need to select several values based on a LOV list that is predefined.
    For selections multiple values, I tried shuttle as list manager. It is placed in a form region. After that I asked changes it redirects me to the report page.
    The column of the table displays the values selected as: person 1: No 2: 3 person

    Question:
    How can I get rid of these: and replace it with commas (,)?
    So that it looks more presentable in the table report.


    Thank you for your help.

    Hello

    If you want that he report only: just use function replace SQL ': 'to','
    example: Select Replace (column, ': ',',') table colonne_1;

    I hope this helps :D

    J :D

Maybe you are looking for