How do I insert multiple rows from a single form ...

How do I insert multiple rows from a single form?
This form is organised by a table. (just as in an excel format)
I have 20 items on a form each row item has five field
+++++++++++ FORM AREA+++++++++++++++++++++++++++++++++++++++++++++++++++++
+Product| qty In | Qty Out | Balance | Date +
+------------------------------------------------------------------------+
+Item1 | textbox1 | textbox2 | textbox3 | date +
+ |value = $qty_in1|value= &qty_out1|value=$balance1|value=$date1 +
+------------------------------------------------------------------------+
+Item 2 | textbox1 | textbox2 | textbox4 | date +
+ |value = $qty_in2|value= $qty_out1|value=$balance2|value=$date2 +
+------------------------------------------------------------------------+
+ Item3 | textbox1 | textbox2 | textbox3 | date +
+------------------------------------------------------------------------+
+ contd | | | +
+------------------------------------------------------------------------+
+ item20| | | | +
+------------------------------------------------------------------------+
+ + + SUBMIT + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Database Structure
+++++++++++++++++
+ Stock_tabe +
+---------------+
+ refid +
+---------------+
+ item +
+---------------+
+ Qty In +
+---------------+
+ Qty Out +
+---------------+
+ Balance +
+---------------+
+ Date +
+++++++++++++++++
Let's say for example user have to the use the form to enter all 10 items or few like 5 on their stock form into 4 different textbox field each lines of your form, however these items go into a "Stock_table" under Single insert transaction query when submit button is pressed.
Please anyone help me out, on how to get this concept started.

Hello,
I have a way to do this, but it would take some hand coding on your part. If you feel comfortable hand writing php code and doing manual database calls, specificaly database INSERT calls you should be fine.
Create a custom form using the ADDT Custom Form Wizard that has all the rows and fields you need. This may take a bit if you are adding the ability for up to 20 rows, as per your diagram of the form area. The nice thing about using ADDT to create the form is that you can setup the form validation at the same time. Leave the last step in the Custom Form Wizard blank. You can add a custom database call here, but I would leave it blank.
Next, under ADDT's Forms Server Behaviors, select Custom Trigger. At the Basic tab, you enter your custom php code that will be executed. Here you are going to want to put your code that will check if a value has been entered in the form and then do a database INSERT operation on the Stock_table with that row. The advanced tab lets you set the order of operations and the name of the Custom Trigger. By default, it is set to AFTER. This means that the Custom Trigger will get executed AFTER the form data is processed by the Custom Form Transaction.
I usually just enter TEST into the "Basic" tab of the Custom Trigger. Then set my order of operations in the "Advanced" tab and close the Custom Trigger. Then I go to the code view for that page in Dreamweaver and find the Custom Trigger function and edit the code manually. It's much easier this way because the Custom Trigger wizard does not show you formatting on the code, and you don't have to keep opening the Wizard to edit and test your code.
Your going to have to have the Custom Trigger fuction do a test on the submitted form data. If data is present, then INSERT into database. Here's a basic example of what you need to do:
In your code view, the Custom Trigger will look something like this:
function Trigger_Custom(&$tNG) {
if($tNG->getColumnValue("Item_1")) {
$item1 = $tNG->getColumnValue("Item_1");
$textbox1_1 = $tNG->getColumnValue("Textbox_1");
$textbox1_2 = $tNG->getColumnValue("Textbox_2");
$textbox1_3 = $tNG->getColumnValue("Textbox_3");
$date1 = $tNG->getColumnValue("Textbox_3");
$queryAdd = "INSERT INTO Stock_table
(item, Qty_In, Qty_Out, Balance, Date) VALUES($item1, $textbox1_1, $textbox1_2, $textbox1_3, $date1)"
$result = mysql_query($queryAdd) or die(mysql_error());
This code checks to see if the form input field named Item_1 is set. If so, then get the rest of the values for the first item and insert them into the database. You would need to do this for each row in your form. So the if you let the customer add 20 rows, you would need to check 20 times to see if the data is there or write the code so that it stops once it encounters an empty Item field. To exit a Custom Trigger, you can return NULL; and it will jump out of the function. You can also throw custom error message out of triggers, but this post is already way to long to get into that.
$tNG->getColumnValue("Item_1") is used to retrieve the value that was set by the form input field named Item_1. This field is named by the Custom Form Wizard when you create your form. You can see what all the input filed names are by looking in the code view for something like:
// Add columns
$customTransaction->addColumn("Item_1", "STRING_TYPE", "POST", "Item_1");
There will be one for each field you created with the Custom Form Wizard.
Unfortunately, I don't have an easy way to do what you need. Maybe there is a way, but since none of the experts have responded, I thought I would point you in a direction. You should read all you can about Custom Triggers in the ADDT documentation/help pdf to give you more detailed information about how Custom Triggers work.
Hope this helps.
Shane

Similar Messages

  • Insert multiple files from a single form

    i'm trying to create a form to allow users to upload and attribute 10 image files at once to a single table. i followed the howto document:
    http://www.oracle.com/technology/products/database/htmldb/howtos/tabular_form.html#MANUAL
    and was able to create a form w/ten blank rows for insertion. however, the htmldb_item package that is used to write out the form controls does not provide an api to write out a file browse form control. is there another api i can use? if not is there a known kludge?

    Scott,
    i modified your suggestion and came up w/a more straight forward solution. here's the complete solution...
    1. create a report based on a sql query:
    select
    x.IMG_SKEY
    ,x.IMG_TITLE_TX
    ,x.IMG_SRCH_KEYWORDS_TX
    ,x.file_browse
    ,x.CATEGORY_CD
    from
    (select
    htmldb_item.hidden(1,IMG_SKEY) img_skey
    ,htmldb_item.text(2,IMG_TITLE_TX,12) img_title_tx
    ,htmldb_item.text(3,IMG_SRCH_KEYWORDS_TX,12) img_srch_keywords_tx
    ,'<input type="file" name="f50" size="30">' file_browse
    ,htmldb_item.select_list_from_query(4,null,'select category_name_tx , category_cd from image_categories order by 1',null,'NO',null,null,null,null,'NO') CATEGORY_CD
    from "#OWNER#"."IMAGES"
    where rownum < 0
    union all
    select
    htmldb_item.hidden(1,null) img_skey
    ,htmldb_item.text(2,null,12) img_title_tx
    ,htmldb_item.text(3,null,12) img_srch_keywords_tx
    ,'<input type="file" name="f50" size="30">' file_browse
    ,htmldb_item.select_list_from_query(4,null,'select category_name_tx, category_cd code_value from image_categories order by 1',null,'NO',null,null,null,null,'NO') CATEGORY_CD
    from dual
    union all
    select
    htmldb_item.hidden(1,null) img_skey
    ,htmldb_item.text(2,null,12) img_title_tx
    ,htmldb_item.text(3,null,12) img_srch_keywords_tx
    ,'<input type="file" name="f50" size="30">' file_browse
    ,htmldb_item.select_list_from_query(4,null,'select category_name_tx, category_cd code_value from image_categories order by 1',null,'NO',null,null,null,null,'NO') CATEGORY_CD
    from dual
    note: union the null selects to get as many null rows as you want. i named the file control f50 to avoid conflicts. this control name is an array parameter in the wwv_flow.accept procedure that the form submits to. also, i unioned the null selects to the original table query which fetches no rows. this probably isn't necessary, but i left it in from the original example and had it select nothing because i wasn't sure if htmldb refrenced the column datatypes at all.
    2. create a page item with the same name as your file control(f50) and change the display = never.
    question: Scott, can you give me some insight into why you need this page item for the files to be uploaded. the files won't upload w/o the page item.
    3. create a submit button which submits the page to itself. *make sure the button "database action = SQL INSERT action" or your files will not be uploaded to the wwv_flow_file_objects$ table
    4. create a process to handle the processing of the form:
    process point - after computations and validations
    run process - once per page visit(default)
    process:
    declare
    v_img_skey number;
    begin
    for i in 1..htmldb_application.g_f50.count
    loop
    if htmldb_application.g_f50(i) is not null then
    begin
         select universal_seq.nextval
         into v_img_skey
         from dual;
    insert into images(
    img_skey
    ,img_title_tx
    ,img_srch_keywords_tx
    ,icat_category_Cd
    ,img_owner_name_tx
    ,img_last_updated_dt
    values(
    v_img_skey
    ,htmldb_application.g_f02(i)
    ,htmldb_application.g_f03(i)
    ,htmldb_application.g_f04(i)
    ,:APP_USER
    ,sysdate
    end;
    end if;
    end loop;
    end;
    note: the value returned from the array htmldb_application.g_f50(i) will be the internal name of the file uploaded. i stripped down my code and removed the sections that move the file from flows_files.wwv_flow_file_objects$ into an image object and inserts it into my custom table, but anyone can use the technical notes on otn and metalink to figure it out.

  • How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection

    How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection.
    I have a multiple rows on PDF form. All rows have 4 textfields. I want to submit the multiple rows data to a method defiened in webservice.
    Unable to retrieve the data in multiple rows within webservice method.

    Hi Paul,
    I'm now able to save the retrieved xml in a hidden text field and create dynamic table, and I'm able to fill this table from the XML, but the problem is that I could not find the correct way to loop on the xml, what I'm trying to say, the table will have number of rows with the data of the first row only, so can you tell me the right way to loop on the xml!
    this is my code
    TextField1.rawValue=xmlData.document.rawValue;
    xfa.datasets.data.loadXML(TextField1.rawValue, true, false);
    for(var i=0; i<count; i++)
    xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Num").rawValue = xfa.datasets.data.record.num.value;
    xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Name").rawValue = xfa.datasets.data.record.name.value;
    Table1.Row1.instanceManager.addInstance(true);
    Thanks
    Hussam

  • Inserting multiple rows using a single Insert statement without using dual

    Hi all,
    i am trying to insert multiple rows using a single insert statement like the below one.
    The below one works fine..
    But is there any other change that can be done in the below one without using dual...
    insert all
    into ps_hd_samp (num1,num2) values (1,1)
    into ps_hd_samp (num1,num2) values (2,2)
    into ps_hd_samp (num1,num2) values (3,3)
    select 1 from dual;

    NiranjanSe wrote:
    Hi all,
    i am trying to insert multiple rows using a single insert statement like the below one.
    The below one works fine..
    But is there any other change that can be done in the below one without using dual...
    insert all
    into ps_hd_samp (num1,num2) values (1,1)
    into ps_hd_samp (num1,num2) values (2,2)
    into ps_hd_samp (num1,num2) values (3,3)
    select 1 from dual;
    SQL> create table ps_hd_samp (num1 number,num2 number);
    Table created.
    SQL> insert all
      2  into ps_hd_samp (num1,num2) values (1,1)
      3  into ps_hd_samp (num1,num2) values (2,2)
      4  into ps_hd_samp (num1,num2) values (3,3)
      5  select count(*)
      6  from ps_hd_samp;
    3 rows created.
    SQL> select * from ps_hd_samp;
          NUM1       NUM2
             1          1
             2          2
             3          3

  • Insert multiple rows from cursor to table

    Hi,
    I want to insert multiple rows retrieved from cursor to a table without looping the cursor till the end of cursor.
    I have the following structure, plz guide me.
    Create procedure procedure_name as
    cursor mycursor as
    select * from table1; --returns multiple row
    t_data table1%rowtype;
    begin
    fetch mycursor to t_data;
    loop
    exit when cursor not found;
    insert to table2
    end loop;
    end procedure;
    ===========================
    Now my cursor contains multiple records. I can iterate the records in loop and insert data to another table e.g table2 with same structure.
    But I want to insert the total data at a time without looping the cursor for each data.Please suggest how to do this ?
    Thanks in advance.

    You should be able to do it in a single statement (assuming table1 and table2 have the same columns/datatypes)
    insert into table2 (select * from table1);

  • How to insert multiple rows in a single shot using insert command?

    Hi,
    If we insert one row, we can use "insert into" command. I want to insert multiple rows into the table in a single shot. Is there any SQL command for insert multiple rows into the table?
    Plese give the solution.
    Thanks,
    chelladurai

    If you would like to do it with SQL, this would be one of the ways to achive it:
    SQL*Plus: Release 10.2.0.4.0 - Production on Fri Sep 25 10:12:59 2009
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, Data Mining and Real Application Testing options
    SQL>
    SQL> desc leap
    Name                                      Null?    Type
    FIRST_PRICE                                        NUMBER(16,6)
    NEXT_PRICE                                         NUMBER(16,6)
    SQL>
    SQL> select * from leap;
    no rows selected
    SQL>
    SQL>
    SQL> !vi multirow_insert.sql
    SQL> !cat multirow_insert.sql
    insert into leap(first_price, next_price) values (1,2);
    insert into leap(first_price, next_price) values (3,4);
    insert into leap(first_price, next_price) values (5,6);
    SQL>
    SQL> @multirow_insert.sql
    1 row created.
    1 row created.
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>
    SQL>
    SQL> select * from leap;
    FIRST_PRICE NEXT_PRICE
              1          2
              3          4
              5          6
    SQL>

  • How to pass out multiple rows from EJB method?

    I need a sample for passing multiple rows from a EJB query method
    (using SQLJ). All I found in existing sample code is query on a
    single row and pass out as a bean class e.g Emp class with some
    getXX() method.
    What I'm currently doing is to convert the Iterator to a Vector
    and pass the Vector out, which means I've to code a bean class,
    use a Vector and later use a Enumeration to read the result. Is
    there a simpler way to receive multiple rows from EJB?
    In EJB:
    while ( empIter.next() ) {
    EmpVect.addElement( new Emp( emps.empNo(), emps.eName(),
    emps.job(), emps.deptNo()) );
    return EmpVect;
    In client:
    Vector empVect = empEJB.getEmployees(123);
    Enumeration employees = empVect.elements();
    while ( employees.hasMoreElements() ) {
    emp = ( Emp ) employees.nextElement();
    System.out.println(" " + emp.getEName());

    Hi Ankit,
    There is a workarround that requires some excel work.
    Here you need to follow the above mentioned steps along with this you need an additional combo box (wont be displayed at runtime, it will fetch the entire data if we select blank for the first combo box).
    Now suppose we are using 2 combobox C1 and C2 and our data is from B3 to F6.
    Now for C1 (one we are using for selection)
    1. select the labels as Sheet1!$B$2:$B$6 (a blank cell is added for all selection)
    2. Insertion type as filtered Rows
    3. Take source data as Sheet1!$B$2:$F$6 (includeing one blank row)
    4. selected Items as none
    5. for C2 labels as Sheet1!$A$3:$A$6 source data as Sheet1!$B$3:$F$6 destination as Sheet1!$B$14:$F$17.
    6. Selected Item : Sheet1!$B$9  (blank  Type dynamic). So it will select the entire table, if nothing is selected.
    7. take a Grid component and map it to Sheet1!$H$9:$L$12. use formula as =IF(IF($B$9="",B14,B9)=0,"",IF($B$9="",B14,B9)) on cell H9. Where we take H6 to L12 as final data set. Tis will become the data for next set fo Combo box for further selection.
    8. follow the same steps for other combobox selections.
    9. control the dynamic visibility of grids on the basis of Destination cell (like B9).
    Revert if you need further clarification.
    Regards,
    Debjit

  • How to insert multiple rows in a single insert statement in MaxDB?

    hi,
    I was looking at syntax but i could not get it right.. may be some could help me.
    // Insert single row works fine
    INSET INTO test_table(column_name) values (value1) IGNORE DUPLICATES
    // Insert multiple rows, doesn't
    INSET INTO test_table(column_name) values (value1), (value2), (value3) IGNORE DUPLICATES
    Can somebody help me with this.
    thanks,
    sudhir.

    Multiple inserts do only work with parametrized statements, usually used in interfaces like JDBC, ODBC etc.
    With static SQL statements it is not possible.
    Regards Thomas

  • Extract Multiple Rows from a Single Table into a Single Row in a New Table

    I have a table in a database that contains contact data like name, address, phone number, etc.
    The folks who designed the database and wrote the application wrote it so that all contact records are placed in that table, regardless of contact type. In fact, the contacts table does not even have a column for "type" even though there are many
    different types of contacts present in that table.
    I am trying to write a mail merge style report in SRSS, that gets sent to a specific type of contact, based on criteria provided that must be obtained from another table, and that data is then used to get back to a specific set of contacts from the contacts
    table.
    The attached file directly below describes my problem and all related information in an extremely detailed way.
    SRSSMailMergeIssue.pdf
    Unless there is a way to make a SRSS Tablix point to two different data sets in SRSS, it looks like I have to combine multiple rows from the same table into a new table.
    If anyone can review the details in the attached pdf file and possibly point me in the direction I need to run to solve this probelm, I would greatly appreciate it.
    I also included a document (below) that shows the tables I reference in the probelm description.
    dbtables.pdf

    I found a solution.... and posted it below
    select
    dk.ucm_docketnumber [UCM DocketNumber],
    dk.ucm_docketid [UCM DocketID],
    vc.FirstName [Victim FirstName],
    vc.MiddleName [Victim MiddleName],
    vc.LastName [Victim LastName],
    vc.Suffix [Victim Suffix],
    vc.Address1_Line1 [Victim AddressLine1],
    vc.Address1_Line2 [Victim AddressLine2],
    vc.Address1_Line3 [Victim AddressLine3],
    vc.Address1_City [Victim City],
    vc.Address1_StateOrProvince [Victim StateProvince],
    vc.Address1_PostalCode [Victim Postalcode],
    oc.FirstName [Offender FirstName],
    oc.MiddleName [Offender MiddleName],
    oc.LastName [Offender LastName],
    oc.Suffix [Offender Suffix],
    oc.Address1_Line1 [Offender AddressLine1],
    oc.Address1_Line2 [Offender AddressLine2],
    oc.Address1_Line3 [Offender AddressLine3],
    oc.Address1_City [Offender City],
    oc.Address1_StateOrProvince [Offender StateProvince],
    oc.Address1_PostalCode [Offender Postalcode],
    pc.FirstName [Arresting Officer FirstName],
    pc.MiddleName [Arresting Officer MiddleName],
    pc.LastName [Arresting Officer LastName],
    pc.Address1_Line1 [Arresting Officer AddressLine1],
    pc.Address1_Line2 [Arresting Officer AddressLine2],
    pc.Address1_Line3 [Arresting Officer AddressLine3],
    pc.Address1_City [Arresting Officer City],
    pc.Address1_StateOrProvince [Arresting Officer StateProvince],
    pc.Address1_PostalCode [Arresting Officer Postalcode]
    FROM ucm_docket dk
    left outer join ucm_victim v on dk.ucm_docketid = v.ucm_docketnumber
    left outer join contact vc on vc.contactid = v.ucm_victimlookup
    left outer join ucm_offender o on o.ucm_offenderid = dk.ucm_offenderlookup
    left outer join contact oc on oc.contactid = o.ucm_individualid
    left outer join contact pc on pc.contactid = dk.ucm_ArrestingOfficerLookup
    WHERE (dk.ucm_docketnumber = @DocketNUM)

  • How can I automate multiple Sheets from a single Sheet?

    I have a different kind of Resumé because of my job field.  Because of this the easiest way for me to build it was to use Numbers.  I have all of the information in there for the different aspects of my job.  Now, I need to take this information and only use part of it for seperate resumés but include crossing parts on multiple resumés.  So far, I have updated my "complete" resumé and then recreated each of the other ones by deleting the parts I don't want.  I was wondering if there is a way to automate this so that when I update my "complete" resumé it can add to the sections I need in the other ones.
    Based on what I know I figure there is a way to say on a new sheet to say copy these lines to these lines and then these lines to these lines.  That said, I can't just take the cells and recall information from specific cells in the other sheet as when I add a new line it will move everything and new reference cells would need to be added.
    Is what I am wanting possible?

    Hi Brett,
    Ian is thinking along the same lines that I started with—checkboxes to select the items to be included in the specific version of the resume. As you've noted, this Is labour intensive when reproducing a resume that has been printed before as the checkboxes need to be rechecked each time.
    A technique that may offer a way around this is to create an index (or tag) column containing codes marking each line that is to be included in specific résumés. Here's an example showing such a table, set up to display nine subsets of the complete list. (Ignore the contents of the columns other than the last column—it's just there to give an easy view of which rows have been displayed.)
    Ten codes are used: r0 is in all rows, so that code displays the complete résumé. Each of the other codes, r1, r2…r8, and r9, appear only in the rows needed for one specific subset of rows from the complete set.
    Complete set:
    Set r1:
    Set r3:
    Set r3 was selected and is shown with the Codes column hidden. Reorganize does not require that the column on which the table is filtered be visible.
    My original thought was to create a second, index column, using codes like these to create a dynamic index list, then using the index list to populate a second table for the 'partial' resume. The major difficulty I foresaw with that method arose from the variety of formats in your complete table. Formulas are great for transfering content, but less so for reformatting rows as a table is filled. Filtering the table hides some of the data,but does not ove any of it to a different row, so formatting of the individual rows should not be affected.
    Regards,
    Barry
    PS: You will probably want to use Fill down to repeat code values in a number of consecutive rows. If so, make sure that the string to be repeated ends in a letter not a numeral. Numbers will increment the value of a number ending a string when filled down, but will not change the value of a string that ends in a letter. The letter can be one that is not included in any of the codes.

  • How do I copy multiple events from a single calendar to another calendar?

    I have multiple events from my "Family" calendar that I want to move. I would like to create a new calendar and move only specific events from my "Family" calendar to this new calendar. I have tried to select each event, then export, but this doesn't seem to work. It seems to export all events in the "Family" calendar, not just the ones that have been selected. Is there any way to do this aside from exporting each event one at a time and reimporting to a new calendar?

    Drag them there. The volume they’re put onto needs to be formatted as Mac OS Extended.
    (111592)

  • How to insert multiple values from a single LOV box...?(cont)

    Hi..I have a medical form and under the conclusions box, I have set up a LOV with various values. That part works fine.
    The thing is I do not want to pick a single value. The format which I write in the conclusions in that box is
    1. "............"
    2. " "
    3...etc...
    But when I go to choose the 2nd value, it replaces the first one I had inserted. Any tips please??

    "My way", should have done exactly that. Every time you open the lov and choose a value it should be aapended to the already existing value in the textfield (assuming taht the length of the textfield is long enough)."
    -Well thats the thing, If I try to add more than one value into ONE text field when I open up the LOV..it just replaces the first value with teh second value. Right now wihtout the LOV this is the format it gets stored into the database. The conclusions are typed in manually and when i query from sql plus it comes the way I typed it in. For example:
    1. Mild concentric LVH
    2. Normal LV systolic function ; EF 75 %
    3. Diastolic dysfunction
    I just copy/pasted that from sql. This is saved in a column in a table named ProcedureSummary. I want to insert values exactly this way into one field. Except when i do that currently with the LOV, it replaces the old value with a new value.
    I hope i make sense, sorry for the bother!

  • How i can display multiple row from one row

    Hi ,
    i have table called temp_probabaility and contain 2 colomns (id1 , path )the values as below ,
    ID1 Path
    3 ;2,4,6
    4 ;1;2;3;5
    5 ;1;2;3;4;5
    i need to convert the values to be like below ,
    id1 path
    3 2
    3 4
    3 6
    4 1
    4 2
    4 3
    4 5
    please any help ?
    Edited by: user11309581 on May 13, 2011 4:13 PM
    Edited by: user11309581 on May 13, 2011 4:16 PM
    Edited by: user11309581 on May 13, 2011 4:18 PM

    BluShadow wrote:
    it just needs to use the \d+ as you did.Not sure what you mean. Your code did not produce any rows for id1=6:
    SQL> with x as (select 6 as id1, ';;;' path from dual)
      2  --
      3  -- end of test data
      4  --
      5  select id1, regexp_substr(path,'\d+',1,rn) as path
      6  from   x cross join (select rownum rn
      7                       from dual
      8                       connect by rownum <= (select max(length(regexp_replace(path,'[^;]'))) from x))
      9  where regexp_substr(path,'\d+',1,rn) is not null
    10  order by 1,2
    11  /
    no rows selected
    SQL> with t as (select 6 as id1, ';;;' path from dual)
      2  -- end of on-the-fly data sample
      3  select  id1,
      4          regexp_substr(path,'\d+',1,column_value) path
      5    from  t,
      6          table(
      7                cast(
      8                     multiset(
      9                              select  level
    10                                from  dual
    11                                connect by level <= length(regexp_replace(path,'[^;]'))
    12                             )
    13                     as sys.OdciNumberList
    14                    )
    15               )
    16  /
           ID1 PAT
             6
             6
             6
    SQL> Same when path is NULL:
    SQL> with x as (select 6 as id1, '' path from dual)
      2  --
      3  -- end of test data
      4  --
      5  select id1, regexp_substr(path,'\d+',1,rn) as path
      6  from   x cross join (select rownum rn
      7                       from dual
      8                       connect by rownum <= (select max(length(regexp_replace(path,'[^;]'))) from x))
      9  where regexp_substr(path,'\d+',1,rn) is not null
    10  order by 1,2
    11  /
    no rows selected
    SQL> with t as (select 6 as id1, '' path from dual)
      2  -- end of on-the-fly data sample
      3  select  id1,
      4          regexp_substr(path,'\d+',1,column_value) path
      5    from  t,
      6          table(
      7                cast(
      8                     multiset(
      9                              select  level
    10                                from  dual
    11                                connect by level <= length(regexp_replace(path,'[^;]'))
    12                             )
    13                     as sys.OdciNumberList
    14                    )
    15               )
    16  /
           ID1 P
             6
    SQL> SY.

  • How do I delete multiple rows from datagrid?

    Hi,
    I have a datagrid which has an item renderer on the 1st column which displays a checkbox. I wish to delete all the rows of data from my datagrid which have the checkbox selected.
    I'd be very grateful if anyone can anyone help me with this.
    Thanks in advance,
    Xander

    Test this:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()" layout="vertical" xmlns:components="components.*">
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                [Bindable]
                private var dp:ArrayCollection;
                private function init():void
                    var sa:Array = [{selected: false, value: "Some value"}, {selected: true, value: "Some other value"}];
                    dp = new ArrayCollection(sa);
                private function handleDelete():void
                    var na:Array = dp.source.filter(function callback(item:*, index:int, array:Array):Boolean
                                return item.selected == false;
                    dp.source = na;
            ]]>
        </mx:Script>
        <mx:DataGrid dataProvider="{dp}">
            <mx:columns>
                <mx:DataGridColumn headerText="Column 1" dataField="selected">
                    <mx:itemRenderer>
                        <mx:Component>
                            <mx:CheckBox selected="{data.selected}" click="data.selected = event.target.selected"/>
                        </mx:Component>
                    </mx:itemRenderer>
                </mx:DataGridColumn>
                <mx:DataGridColumn headerText="Column 2" dataField="value"/>
            </mx:columns>
        </mx:DataGrid>
        <mx:Button label="Delete selected" click="handleDelete()"/>
    </mx:Application>
    Dany

  • How to display the multiple rows in a single column ?

    Hi,
    I have the Query like this :
    SELECT MS.SUBJECT, MS.MESSAGEDESC, MS.MSGDATE, MAT.ATTACHMENT
    FROM MESSAGES MS, MSESAGEATTACHEMTASSO MAA, (select pga.programid,
    act.accountname,
    row_number() over(partition by pga.programid order by act.accountname) rn
    from accounttypes act, programpursesasso pga
    where act.accounttypeid = pga.accounttypeid ) MSGATTACHMENTS
    WHERE MS.MESSAGEID = MAA.MESSAGEID
    AND MAA.MSGATTACHMENTID = MAT.MSGATTACHMENTID
    AND MS.MESSAGEID = 1;
    If i have multiple messageAttachments for single message ., i want to display them in a single row.,
    like :
    subject messagedesc msgdate attachment1 attachment2 .....attachmentn
    test test 10/10/2007 test test test
    can any one help me out ., how can i do this using simple sql query ?

    Hi,
    Thanks for the Reply .,
    I have the 2 table like :
    DESC MESSAGES;
    Name Type Nullable Default Comments
    MESSAGEID NUMBER(16)
    EMAILFROM VARCHAR2(50) Y
    EMAILTO VARCHAR2(50) Y
    SUBJECT VARCHAR2(500) Y
    MESSAGEDESC VARCHAR2(2000) Y
    MSGDATE DATE Y
    MSGSTATUS NUMBER(1) Y
    MSGDELETESTATUS NUMBER(1) Y
    SQL> DESC MESSAGES;
    Name Type Nullable Default Comments
    MESSAGEID NUMBER(16)
    EMAILFROM VARCHAR2(50) Y
    EMAILTO VARCHAR2(50) Y
    SUBJECT VARCHAR2(500) Y
    MESSAGEDESC VARCHAR2(2000) Y
    MSGDATE DATE Y
    MSGSTATUS NUMBER(1) Y
    MSGDELETESTATUS NUMBER(1) Y
    SQL> DESC MSGATTACHMENTS;
    Name Type Nullable Default Comments
    MSGATTACHMENTID NUMBER(16)
    ATTACHMENT CLOB
    ATTACHMENTDATE DATE Y
    SQL> DESC MSESAGEATTACHEMTASSO;
    Name Type Nullable Default Comments
    MSGATTCHID NUMBER(16)
    MESSAGEID NUMBER(16) Y
    MSGATTACHMENTID NUMBER(16) Y
    What I need Is :
    If One Msg is having multiple attachement , then i want to display all the attachment in a single row along with MsgSubject, MsgDate, MsgDesc like
    I want to dipaly the MsgSubject, MsgDesc, MsgDate, Attachment1
    MsgSubject MsgDate Msgdesc Attachment1 Attachment2 Attachment3 ...etc

Maybe you are looking for

  • Is it possible to install a version of Polish?

    Is it possible to install a version of Polish?

  • Bridge New keywords are not shown on startup

    Hi, I have some images, (in folder X) which I tagged with NEW keywords I created. When I reopen bridge, these new keywords are not shown by default. In ordert to see the above keyword, in the keyword panned, i have to navigate to folder X. Is this a

  • ITunes 10.5.2 hangs when transferring to iPhone

    Ever since I updated to 10.5.2 iTunes hangs whenever I manually add/remove podcasts and songs to my iPhone 4S.  It always says that I am trying to transfer more songs than I selected.  I could highlight one song and drag it to my phone, but then the

  • IOS4 Upgrade Questions

    Hello, Im considering upgrading from iPhone OS 3.1.2 on my iPod Second Generation to iOS 4. I have many apps which store information (eg. game saves) which I can't retrieve (eg. save to my PC). Will I lose this when I upgrade? Are the things ive hear

  • Bopf save method

    Hi all, we have scenario where we are updating multiple record in bopf tables. in this we are using modify and save method of transnational manager. if we are updating 10 records and if  5th record is getting error while saving . it will not update r