inserting multiple data in a single textfield

is this possible? something like "select name from table where department_id = 2" and put it in a textfield (or any favorite element) and the output would be like "sanchez, goodyear, hillman" <-given shud also be separated by comma.

Looks like you want to combine the result set of a multirow query and display all elements in a single text element in a form. If this is correct, you can do this with a cursor to loop and concatenate each line containing the text element. Where to put the code depends on when you need to see. My guess would be a when-validate-Item trigger or after request, but it could also be a time - new - block - Instance - all depends on your needs. (B-)

DECLARE
   CURSOR get_names IS
      /* Your SQL Statement Here */
      /* For some reason, the Forum Editor won't save my post */
      /* if I put your SQL statement here. Very wierd!! */
BEGIN
   FOR rec IN get_names LOOP
      IF ( :MY_BLOCK.TEXT_ITEM IS NULL ) THEN
         :MY_BLOCK.TEXT_ITEM := rec.Name;
      ELSE
         :MY_BLOCK.TEXT_ITEM := :MY_BLOCK.TEXT_ITEM || ', ' || rec.Name;
      END IF;
   END LOOP;
END;

Hope this helps,
Craig

If a response is appropriate or useful, please mark accordingly.

Published by: Silvere April 27, 2010 07:59

Published by: Silvere April 27, 2010 08:01

Tags: Oracle Development

Similar Questions

  • How to insert multiple lines using a single query

    Hi all

    How to insert multiple lines using a single query to the emp table?
    I have the number of rows to insert into table x. consumes a lot of time. I tried to insert several lines using a single query, but get errors. I know exactly the query to do this.


    Thank you
    Sunil

    Like this?

    SQL> create table test(id number , dt date);
    
    Table created.
    
    SQL> insert into test values(&a,&b);
    Enter value for a: 1   --- It asked me and I entered 1
    Enter value for b: sysdate  --- It asked me and I entered sysdate
    old   1: insert into test values(&a,&b)
    new   1: insert into test values(1,sysdate)
    
    1 row created.
    
    SQL> 
    

    g.

  • Insert multiple records in the single form

    Hi all

    I met already insert many rows into a table using ADF BC. The solution is in the following thread

    Re: How to create several new lines in the Table of the ADF?

    However,.
    The above solution is useful when you want to enter new values as well as all the table entries is displayed.
    What can I do if I don't want all values in the table, but just a page 'AddEntries' where I can only add new lines without going through the table entries is displayed.

    As,

    Say a form has 5 rows

    Each line has empId, eMailSlNo, send attributes

    EmpId is the same for all 5 recordings but emailId is different.

    EmpId eMailSlNo plus the PK.

    empId generated by the sequence.

    Now, on presentation of the form, I want all five records to be inserted.

    (can I use ADF form instead of the table of the ADF for the ViewObject in this case. I tried ADF form but I could only insert 1 plug at the same time).

    I use 10.1.3.4

    Help, please.

    Thanks in advance,
    Shri

    Published by: newtoOTN on December 29, 2009 18:02

    Shri salvation,

    ADF form is intended for the single insert/update. For multiple insert/update/delete using the collection as table UI is preferred. I guess your db table or table design INTERFACE default (in my opinion but I do not know your usecase entirely, so I guess might b wrong).

    I would say,

    -make EmpId as PK
    -have another table to store EmpId (foreign key), emailSiNo, email
    -Having the relationship of the master / detail between the British Colombia ADF db tables.
    -Create master / detail UI and on the selection of the master, view the details and if no record is found does not add files and commit.

    See these examples:
    http://www.Oracle.com/technology/products/jdev/tips/Mills/MasterDetailSync/Master_Detail_Synchronization_in_ADF_Faces.html
    http://andrejusb.blogspot.com/2007/06/create-edit-and-delete-operations-in.html

    Hope it makes sense.

    ~ K

  • How to insert Mutiple data in a single column

    I have an E_CTIC_DTA table with a clob column

    I want to insert all the data from EMP in this clob column that too in a single line
    When each series of records must be in a new line.

    for example: 121 AH 5000 50 131 MACIEL 1000 10 141 KING 5000 50

    The text file should look like below when we choose the CLOB

    121 50 5000 SALOME
    131 1000 10 MACIEL
    141 KING 5000 50

    Any reference links or suggestions please...

    Thanks in advance...

    Hello

    A simple example:

    DECLARE
        v_clob CLOB;
        v_line VARCHAR2(4000);
    BEGIN
        FOR reg IN (SELECT *
                    FROM   employees e)
        LOOP
            -- Loading new line (maybe using a procedure, etc).
            v_line := reg.employee_id || reg.first_name;
    
            -- Adding the line to the clob
            v_clob := v_clob || v_line || CHR(13);
        END LOOP;
    
        -- Inserting into the table
        INSERT INTO E_CTIC_DTA
        VALUES v_clob;
    
        COMMIT;
    END;
    /
    

    Kind regards

  • Insert multiple rows in a database

    Hello
    I worked on a project that takes a JMS queue xml document and inserts the data into db. But the problem here is that there may be any number of data sets. I use EPCO for my work, but no matter what I do, the data is not simply inserted. Could you any body please help me? Here is an example of the message that I'm trying to insert as the XSD for the JCA and entry documents.

    XSD for JMS Message:

    <? XML version = "1.0" encoding = "windows-1252"? >
    < xsd: Schema container = "http://www.w3.org/2001/XMLSchema".
    xmlns = "http://www.example.org".
    targetNamespace = "http://www.example.org".
    elementFormDefault = "qualified" >
    < xsd: element name = "canonical" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "order" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "data" maxOccurs = "unbounded" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "rowCode" type = "xsd: String" / >
    < xsd: element name = "productNumber" type = "xsd: String" / >
    < xsd: element name = "attributeType" type = "xsd: String" / >
    < xsd: element name = "attributeCode" type = "xsd: String" / >
    < xsd: element name = "transactionType" type = "xsd: String" / >
    < xsd: element name = "timestamp" type = "xsd: DateTime" / >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >
    < / xsd: Schema >


    JCA XSD:

    <? XML version = "1.0" encoding = "UTF - 8"? >
    < xs: Schema targetNamespace = "http://xmlns.oracle.com/pcbpel/adapter/db/top/InsertData" xmlns = "http://xmlns.oracle.com/pcbpel/adapter/db/top/InsertData" elementFormDefault = "qualified" attributeFormDefault = "qualified" xmlns: XS = "http://www.w3.org/2001/XMLSchema" >
    < xs: element name = "OrderDataCollection" type = "OrderDataCollection" / >
    < name XS: complexType = "OrderDataCollection" >
    < xs: SEQUENCE >
    < xs: element name = "OrderData" type = "OrderData" minOccurs = "0" maxOccurs = "unbounded" / >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < name XS: complexType 'OrderData' = >
    < xs: SEQUENCE >
    < xs: element name = "prodnum" type = "xs: Decimal" / >
    < xs: element name = 'attrtype"minOccurs ="0"nillable ="true">
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:maxLength value = "20" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: element >
    < xs: element name = "attrcode" minOccurs = "0" nillable = "true" >
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:maxLength value = "10" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: element >
    < xs: element name = "transtype" minOccurs = "0" nillable = "true" >
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:maxLength value = "1" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: element >
    < xs: element name = "ordertime" type = "xs: DateTime" minOccurs = "0" nillable = "true" / >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < / xs: Schema >

    Input samples:

    <? XML version = "1.0" encoding = "windows-1252"? >
    < ProductData >
    < header >
    < rowCode >: < / rowCode >
    < interfaceCode > H6D9J7 < / interfaceCode >
    < createdOn >
    < date >
    < year > 2011 < / year >
    < month > 05 < / month >
    < day > 23 < / day >
    < / date >
    < time >
    < time > 02 < / time >
    < minute > 05 < / minute >
    < seconds > 11 < / seconds >
    < / time >
    < / createdOn >
    < description > Front Shop of the attributes of FMS to JDA PMM < / description >
    < / header >
    < body >
    < data >
    < rowCode > D < / rowCode >
    < other > 0004567 < / productNumber >
    < attributeType > MIMI < / attributeType >
    < attributeCode > CCCCCCCjjj < / attributeCode >
    < transactionType > A < / transactionType >
    < timestamp >
    < date >
    < year > 2011 < / year >
    < month > 02 < / month >
    < day > 19 < / day >
    < / date >
    < time >
    < time > 02 < / time >
    < minute > 05 < / minute >
    < seconds > 11 < / seconds >
    < / time >
    < / timestamp >
    < / data >
    < data >
    < rowCode > D < / rowCode >
    < other > 0004567 < / productNumber >
    < attributeType > TTTTTT2 < / attributeType >
    < attributeCode > CCCCCCjjj2 < / attributeCode >
    < transactionType > A < / transactionType >
    < timestamp >
    < date >
    < year > 2011 < / year >
    < month > 02 < / month >
    < day > 19 < / day >
    < / date >
    < time >
    < time > 02 < / time >
    < minute > 05 < / minute >
    < seconds > 11 < / seconds >
    < / time >
    < / timestamp >
    < / data >
    < / body >
    <>footer
    < rowCode > Z < / rowCode >
    < interfaceCode > H6D9J7 < / interfaceCode >
    < numberOfRows > 000000000002 < / numberOfRows >
    < / footer >
    < / ProductData >

    I will be really grateful if someone can help me. Thank you.

    Check below link it may help you

    How to insert multiple records using the single DB adapter

    Thank you
    AJ

  • Track of multiple graphs on a single diagram of waveform with dynamic data types

    I'm putting multiple charts on a single diagram of waveform and data contract error. I was wondering if it has something to do with the fact that the dynamic data is used (I have had no problem with other types of data in the past). Does anyone know how to fix this? I have attached the following .VI. There will be a lot of. Live on the bottom which does not load, but they are not related to this problem.

    Thank you!

    Brian

    I don't know what you're doing now, but a part of your origianl code is simply ridiculous. Your DAQ assistant takes a single point. You convert that into an array. If you had converted into a scalar value (which is) first place, your graphics update would have been fine.

    If you want to remove the DAQ Assistant, and then select generate DAQmx code. You'll be a little more closely, but it seems that it generates a NChan DAQmx Read 1Samp instead of a 1Chan 1Samp DAQmx read.

  • Data merge multiple records on a single page?

    I'm working on a grand layout photos grad with names, of the years and images.

    I'm trying to data merge my excel sheet spread if I can have all the images, names and years on one page.  There are about 4000 images total (spread through 5 layouts), so I don't want to put all the pictures individually, the names of types and years individually and then re - arrange when we need to add additional images.

    My problem is that the same data are reapeating in all fields on the page.  Even when I create a new page, the same data made its appearance.

    If I saw the data, I can scroll through all of them, but only ever displays both.  Multiple data by option on the page are grayed out in the data merge window whenever I try.   I use InDesign CS4.

    Y at - it something I am doing wrong, or is there another way to approach it?

    I agree that it seems like if you duplicated data in your source although I can't gray on the option of multiple data page, if I try. It is perhaps something poick to the top with this clip. Good luck & let us know how make you out.

    http://www.theindesigner.com/podcasts/tid43_theindesigner_43.MP4

  • BPEL is create multiple instances of a single HTTP OSB call

    Hello

    Here, I describe how looks like my flow of integration.


    (1) proxy OSB service calls service BPEL (HTTP protocol for help)

    (2) BPEL called two services to OSB using HTTP calls (these two OSB services will insert the data into two tables)

    (3) according to my testcase an OSB service should be managed and second service OSB must fail, so any integration does not work as expected

    (4) but the second OSB service takes 2 minutes when inserting data into the database

    (5) in 2 minutes BPEL is creating an instance more

    How to stop creating multiple instances.

    Thank you and best regards,

    Harsha.

    Automatic recovery is enabled by default in bpel, you can try catch the fault. You can also change the value of MaxRecoverAttempt please go through this link: https://svgonugu.wordpress.com/2013/05/08/auto-recovery-feature-in-bpel/

    Kind regards

    Anshul

  • Update multiple columns from multiple tables in a single UPDATE request

    Hello

    I'm trying to figure if I'm heading in the right direction.

    I want to update multiple columns from multiple tables in a single UPDATE request. Also, I would like to update multiple columns in a table from the tables.

    Scenario 1

    UPDATE Table2, Table 3
    SET T2.Column1 = T1.Column1 
    ,T2.Column2 = T1.Column2
    ,T3.Column2 = T1.Column2
    FROM Table1 T1, Table2 T2, Table3 T3
    WHERE T1.id = T2.id
    and T1.id = T3.id
    
    

    Scenario 2

    UPDATE Table3
    SET T3.Column1 = T1.Column1 
    T3.Column2 = T1.Column2
    ,T3.Column3 = T2.Column3
    ,T3.Column4 = T2.Column4
    FROM Table1 T1, Table2 T2, Table3 T3
    WHERE T3.id = T1.id
    and T3.id = T2.id
    
    

    Hello

    For scenario 1, you must write separate instructions UPDATE table2 and table3.

    To guard against someone else change one of these tables while you act so you can copy all relevant data in a global temporary table and update this global temporary table table3.

    ENGAGE only when two tables have been changed.

    You can write a procedure or an INSTEAD OF trigger to do all this.

    For scenario 2, you can reference many tables that you need when new table3.  It might be more efficient and simpler to use the MERGER rather than UPDATED.  For example:

    MERGE INTO table3 dst

    WITH THE HELP OF)

    SELECT t1.id

    t1.column1

    t1.column2

    t2.column3

    t2.column4

    FROM table1 t1

    JOIN table2 t2 ON t1.id = t2.id

    )             src

    WE (dst.id = src_id

    WHEN MATCHED THEN UPDATE

    SET dst.column1 = src.column1

    dst.column2 = src.column2,

    dst.column3 = src.column3,

    dst.column4 = src.column4,

    ;

  • Calendar - insert multiple records by account number/length of

    Hello

    I would write a process allowing to insert multiple rows in a table. I think it should be a LOOP statement, but I don't know how in the APEX.

    I got a simple form with the following page:

    P2_Calendar_ID-> hidden field, populated by standard processes to Get PK to generate IDS again for the insert statement

    P2_Name-> text field

    P2_Date-> Date picker field

    P2_Duration-> numeric field

    The user name (P2_Name), choose a date (P2_Date) and type in a number (P2_Duration) and send the form. Here, I need the above mentioned process of pl/sql.

    I think that first of all it must be created a loop to generate the Dates of the picked a (P2_Date) and increment the date by the number (P2_Duration), and store dates in the variable. Then there should be another loop to insert the number of records in a table, so it has inserted the same number of rows depending on the number in P2_Duration and with the dates increment according to the P2_Duration.

    Name of the CALENDAR table after columns:

    Calendar_ID-> number)

    Name-> varchar2

    Date-> Date

    Example of what the user will fill in the form above:

    P2_Name-> Vladimir

    P2_Date-> may 9, 2014

    P2_Duration-> 3

    It must be created the following lines in a table CALENDAR:

    Date name Calendar_ID

    1 Vladimir may 9, 2014

    2 Vladimir 10 may 2014

    3 Vladimir may 11, 2014

    Of course the Calendar_ID is generated by the standard Get PK process, which might need to be included in the loop... I think so.

    Thank you for your help.

    Best regards

    Vladimir

    PS: I use the APEX Version: Application Express 4.2.5.00.08

    Hi Vladimir,.

    Simply create a process on submit more info here: 8.5 Page understanding the process , with your touch as a trigger and add the code in this document, similar to the below I would say: and you can just get rid of the hidden element calendar_id

    Thank you

    DECLARE

    DATE OF T_DATE;

    BEGIN

    FOR DATEINC IN 0.TO_NUMBER(:P2_DURATION) - 1 LOOP

    T_DATE: = TO_DATE(:P2_DATE,'DD-MON-YYYY') + DATEINC;

    INSERT INTO CALENDAR (CALENDAR_ID, NAME, DATE) VALUES (CAL_ID_SEQ.nextval,: P2_NAME, T_DATE);

    END loop;

    END;

  • Best practices: multiple partitions on a single vmdk or partition by vmdk

    Hello all-

    I would like to get your opinions on the best practices for the vmdk file server installation program.

    The drive C partition would be allotted for the operating system, while E, F... to store the data of the partitions.

    configuration 1:

    vmdk1 = thick disk of provisioned by a partition of drive c.

    vmdk2 = thickness accommodation provisioned disk partitions E, f...

    Installer 2

    vmdk1 = thick disk of provisioned by a C partition

    vmdk2 = thick disk of provisioned by a partition E

    vmdk3 = thick disk of provisioned by a partition F

    .......

    Also the partitions of multiple data configured as independent + permanent virtual disks due to snapshots. My logic is that OS (C drive) is used for snapshots in test of new software for example while the data partitions act as the storage disks that need to keep the most recent files regardless of the return to an older snapshot. BTW data partitions regularly are Word, excel, photos and so on.

    also, I realize that I could have a single example, E: data with several shared folders partition, but given that each folder is for another Department could cause more trouble when space more and more in the future. Great VMDK could take more time to develop. Not sure again.

    Thank you

    Hello

    in general, virtualization does not change much on the disk IO.

    You can use the same rules that you would use to size a physical server.

    Multiple vmdk mean multiple targets for your I/o load.

    Best solution if IO load/troughput high or low response time should be reached, you create multiple VMDK and spread over several data stores.

    HtH

  • several stores data in a single lun

    I have a fairly big lun I want to separate in small data stores size of different sizes.

    1. is there a way to create multiple data stores in a single lun by the CIV or ssh?

    2. If it is as simple as creating a partition by SSH, which is good practice or at least stable?

    I agree with vmroyale. Do not create more than one LUN per VMFS data store.

    Of http://pubs.vmware.com/vsp40/wwhelp/wwhimpl/js/html/wwhelp.htm#href=fc_san_config/c_general_esx_esxi_san_requirements.html

    SAN requirements general ESX/ESXi

    ...

    Configure your system to have only one LUN per VMFS volume.

    IMO with multiple LUNS with more small instead of a large logical unit number you can optimize the performance of e.g. presenting the LUNS on different management controllers or file LUNS on different axes (depending on your SAN network)

    André

  • Need to insert test data in all the tables that were present in a schema

    Hello

    I use Oracle 9i.

    10 tables were present in my current schema. All tables are not having all the records.

    I need to insert test data in each table using a single procedure. (the table name is inparameter for the procedure)

    For example, I test_emp, test_sal tables.

    CREATE TABLE test_emp (ename varchar2 (40), number of sal);
    CREATE TABLE test_sal (it NUMBER, rank NUMBER, will designate the NUMBER);

    I need to insert some test data in these tables. I shouldn't use utl_file or sql * loader for this.

    I tried below way.
    -- Incomplete code
    
    CREATE OR REPLACE PROCEDURE test_proc_insertdata(p_table_name IN VARCHAR2) IS
    
    BEGIN
    
      --Selected all the column_names, data_type, data_length into a collection variable from user_tab_columns.
    
      SELECT u.column_name, u.data_type, u.data_length
      --BULK COLLECT INTO l_col_tab
        FROM user_tab_columns u
       WHERE u.table_name = p_table_name;
    
      -- generated the values using below statement
      
        SELECT decode(u.DATA_TYPE,'VARCHAR2',dbms_random.string('A', u.data_length),'NUMBER',TRUNC(dbms_random.value(1, 5000)),'DATE',SYSDATE) val_list
        -- INTO collection varaible
          FROM user_tab_columns u
         WHERE TABLE_NAME = p_table_name;  
       
    
    END;
    I am not able to transmit these values to the collection dynamically to the INSERT statement. I tried many ways, but I am not satisfied with the code I've written.

    Please help me if you know a better idea.



    Thank you
    Suri

    Suri wrote:
    Hello

    I use Oracle 9i.

    10 tables were present in my current schema. All tables are not having all the records.

    I need to insert test data in each table using a single procedure. (the table name is inparameter for the procedure)

    For example, I test_emp, test_sal tables.

    CREATE TABLE test_emp (ename varchar2 (40), number of sal);
    CREATE TABLE test_sal (it NUMBER, rank NUMBER, will designate the NUMBER);

    I need to insert some test data in these tables. I shouldn't use utl_file or sql * loader for this.

    I tried below way.

    -- Incomplete code
    
    CREATE OR REPLACE PROCEDURE test_proc_insertdata(p_table_name IN VARCHAR2) IS
    
    BEGIN
    
    --Selected all the column_names, data_type, data_length into a collection variable from user_tab_columns.
    
    SELECT u.column_name, u.data_type, u.data_length
    --BULK COLLECT INTO l_col_tab
    FROM user_tab_columns u
    WHERE u.table_name = p_table_name;
    
    -- generated the values using below statement
    
    SELECT decode(u.DATA_TYPE,'VARCHAR2',dbms_random.string('A', u.data_length),'NUMBER',TRUNC(dbms_random.value(1, 5000)),'DATE',SYSDATE) val_list
    -- INTO collection varaible
    FROM user_tab_columns u
    WHERE TABLE_NAME = p_table_name;  
    
    END;
    

    I am not able to transmit these values to the collection dynamically to the INSERT statement. I tried many ways, but I am not satisfied with the code I've written.

    Please help me if you know a better idea.

    Thank you
    Suri

    With some effort, you can write dynamic insert queries. Read the data dictionary views ALL_TABLES and ALL_TAB_COLUMNS to get the data you need. You may need to limit the list to the tables you specify to hardcode the names of the tables. You can read the views for the information of table and column that you need generate the insert column orders. It will be a lot of work and it might be easier to simply hardcode values. Dynamic SQL is difficult to debug and work with: (.) Something like this (untested and totally undebugged)

    declare
      cursor v_tab_col(p_table_name) is select * from all_tab_columns where table_name = p_table_name;
      v_text varchar2(32767);
      v_table_name varchar2(30);
    begin
      v_table_name := 'DUAL';
      --chr(10) is a newline for readability when debugging
      v_text := 'insert into '||v_table_name||chr(10)||'(';
      --loop to build column list
      for v_tab_rec in v_tab_col loop
        --add comma if not first item in list
        if v_tab_col%rowcount > 1 then
          v_text := v_text ||',';
        end if;
        v_text := v_text || v_tab_rec.column_name;
      end loop;
      v_text := v_text ||') values ('||
      --loop to build column values
      for v_tab_rec in v_tab_cur loop
        if (v_tab_rec.datatype = 'VARCHAR2') then
          --add comma if not first item in list
          if v_tab_col%rowcount > 1 then
            v_text := v_text ||',';
          end if;
          if v_tab_rec.datatype = 'NUMBER' then
           v_text := v_text || '9';
           elsif v_tab_rec.datatype = 'VARCHAR2' then
             v_text := v_text ||'X';
          end if;
      end loop;
      v_text := v_text || ')';
      execute immediate v_text;
    end;
    

    This code is not effective, but shows how to do what you described. You'll have to code for all data types you need and find a way to take into account the primary/foreign keys, yourself. I leave it to you to find a way to avoid selecting the data twice ;)
    Good luck!

    Published by: riedelme on July 24, 2012 13:58

  • Insert multiple records in a database using the DB adapter and stored procedure

    Hi all

    I want to insert multiple records in a database using a stored procedure. I wanted to insert these records using a data adapter and data adapter must be called by a mediator.

    Can anyone suggest me some ideas if it's possible with capabtilities OOB in SOA suite or not?

    Thank you for your help in advance.

    Thank you
    Shiv

    The trick is in the stored procedure. You must use a data type that will handle multiple records I use varray. An example can be found in this post.

    Re: Mutiple calls to AppsAdapter (pl/sql) when the payload has multiple records

    When you read the procedure stored in the db adapter wizard looks and xsd / xml if you have maps accordingly.

    see you soon
    James

  • Insert multiple records in a form with checkboxes

    Hello

    I need to insert multiple records in a database of a form using Coldfusion and am stuck - it works correctly when inserting one record at a time. Basically, the user will choose their name of the employee (EmployeeID) in a dynamic list, then several session (open) numbers that represent classes of training.

    When I try and select several check boxes, I get this error:
    "The number of query values and destination fields is not the same."

    The boxes of the open field are not dynamic, as you can see-how use CFLOOP or any other method to allow several checkboxes be selected, and all open documents is entered into the database on a form?

    I used server behaviors Dreamweaver 8 to create the form - which is limiting I know but I'm not a coder. I hope I can add code here to do things correctly function.



    ----APPLICATION CODE------------------------------------------------------------------

    <!-get employee names->
    < cfquery name = "rsDisplayEmployee" datasource = "FormationRH" >
    SELECT *.
    OF tblEmployees
    ORDER BY LastName ASC < / cfquery >
    <!-->-->
    <! - insert Records - >
    < cfset CurrentPage = GetFileFromPath (GetTemplatePath ()) >
    < cfif IsDefined "(FORM. MM_InsertRecord") AND the FORM. MM_InsertRecord EQ 'form1' >
    < cfquery datasource = "FormationRH" >
    INSERT INTO tblEnrollments (open, EmployeeID)
    VALUES)
    < cfif IsDefined "(FORM. Open") AND #FORM. Open # NEQ "" > "".
    #FORM. Open #.
    < cfelse >
    NULL VALUE
    < / cfif >
    ,
    < cfif IsDefined "(FORM. EmployeeID") AND #FORM. EmployeeID # NEQ "" > "".
    #FORM. EmployeeID #.
    < cfelse >
    NULL VALUE
    < / cfif >
    ) < / cfquery >
    < cflocation url = "2.cfm" >
    < / cfif >
    <!-->-->

    --------FORM CODE-----------------------------------------------------------------------

    < form action = "" < cfoutput > #CurrentPage # < / cfoutput > "id = 'form' name ="form"method ="POST">"
    < table width = "100%" border = "0" cellspacing = "0" cellpadding = "4" >
    < b >
    < td width = "100%" > < h2 > < strong > select an employee name < facilities > < / h2 > < table >
    < /tr >
    < b >
    < td > < select name = "EmployeeID" >
    < cfoutput query = "rsDisplayEmployee" >
    < option value = "#rsDisplayEmployee.EmployeeID #" > #rsDisplayEmployee.LastName #, #rsDisplayEmployee.FirstName # < / option >
    < / cfoutput >
    < / select > < table >
    < /tr >
    < /table >
    < h2 > < strong > select training class < facilities > < / h2 >
    < table width = "600" border = "0" cellspacing = "0" cellpadding = "0" >
    < b >
    < td width = "227" valign = "top" > class < table >
    < td width = "373" valign = "top" > < input name = "Open" type = "checkbox" value = "937" / >
    Date < table >
    < /tr >
    < b >
    < td valign = "top" > class < table >
    < td valign = "top" > < label >
    < input name = "Open" type = "checkbox" value = "936" / >
    < / label >
    Date < table >
    < /tr >
    < /table >
    < br / >
    < input type = "submit" name = "Submit" value = 'Sign Up!' / >
    < input type = "hidden" name = "MM_InsertRecord" value = "form" >
    < / make >

    "Add a line" I want to say that, for each of the checkboxes selected in your form, the code will be to insert a new record in the database table. Sorry I probably didn't phrase it very well.

    so, no, the code does not need to wrap around each element. Instead the code examines the form.fieldnames variable (form.fieldnames, which is a list separated by commas of all fields defined in the form, is automatically submitted to each form submission - you don't have to define yourself somehow) and for each selected checkbox will insert a new record in your table with the check box selected and selected value the value of the id of the employee.

Maybe you are looking for

  • Hypergammas vs Slog2

    I would like a discussion on real-world scenarios for using the new HypergammasHG7 8009 40 G and HG8 8009 G 33. And secondly when these Slog2 better? Thank you!

  • Port additional ethernal PXI

    Should what card I buy for my chassis PXI-1042 if I want to add an additional ethernet port to the system?  I should be able to access this new port ethernet via XP inside my PXI, right?  Is it possible to use a usb converter to ethernet as well?

  • Stand alone HP 8250 printer will not accept the camera 16 GB SD card.

    The message 'card' access error bed. The printer works fine with a card SD 256 MB of the same device. The 16 MB card works fine on my printer HP Photosmart Premium C309. The 8250 has a limitation of size of SD card?

  • No sound after installing windows 7 ultimate.

    I bought a new HARD drive, installed windows 7 ultimate, there is no sound after installing windows7 ultimate. When I attach my old HARD drive, windows XP, I get the sound. Device Manager shows no error. Pls correct me or direct me to over come this

  • How can I download my adobe creative suite 4 to my new laptop without a hard drive?

    I am owner of adobe creative suite 4 design premium. I just bought a new computer, but it is not a hard drive. I downloaded the trial adobe Acrobat and when I inserted my product serial number, it was rejected. How can I download my suite creative ad