Insert server behavior into two tables with ASP.

How do I change the server behavior code INSERT to insert records into several tables using ASP? Information inserted into the first table includes the customer profile, including the legal name, name and surname. What I can accomplish easily using the server behavior. In the second table I want to insert hidden value in a field that corresponds to the value of the current customerID, as well as the model number of the item purchased. Be very specific that I'm not too familiar with the scripts.

The standard insert behavior cannot be easily changed to handle multiple
tables. However there is a very simple tutorial on www.charon.co.uk on the way
to deal with.

--
Paul Whitham
Certified Professional Dreamweaver MX2004
Adobe Community Expert - Dreamweaver

Valleybiz Web design
www.valleybiz.NET

"aonefun" wrote in message
News:emsn18$23F$1@forums. Macromedia.com...
> How do I change the server behavior code INSERT to insert records in
> more
> as a table using ASP? Information inserted into the first table
> includes a
> Customer profile, including the company name, name and surname. What I can
> accomplish easily using the server behavior. In the second table I'd
> as
> to insert a hidden field value that is equal to the value of the current
> customerID, as well as the model number of the item purchased. Please be very
> specific
> as I am not too familiar with the scripts.
>

Tags: Dreamweaver

Similar Questions

  • Gears - error when you try to insert values into a table with multiple columns

    Hello

    I started playing with the gears and SQlLite today and I get an error when I try to insert values into a table with multiple columns.

    I have:

    var db = google.gears.factory.create('beta.database');
        db.open('developerSet');
        db.execute('create table if not exists Developers (DeveloperName text, DeveloperAge int)');
    
        var devName = "Davy"
        var devAge = 32;
    
        try {
            db.execute('insert into Developers values (?, ?)', [devName, devAge]);
            alert('success');
        }
        catch (e) {
            alert(e);
        }
    

    I get the error:

    net.rim.device.api.database.DatabaseException; insert into developers values (?,?): SQL logic error or missing database.

    I use this reference: http://code.google.com/apis/gears/api_database.html

    Everything works if I have only one field as:

    var db = google.gears.factory.create('beta.database');
        db.open('developerSet');
        db.execute('create table if not exists Developers (DeveloperName text)');
    
        var devName = "Davy"
        var devAge = 32;
    
        try {
            db.execute('insert into Developers values (?)', [devName]);
            alert('success');
        }
        catch (e) {
            alert(e);
        }
    

    I use the plug-in Visual Studio 2.0 for 2008 that are running Windows XP SP and Simulator 2.13.0.56

    Thank you

    Davy

    Yes, a SQLite database will persist between battery pulls.  The database is registered either to internal MEM or removable media (not the device memory), depending on which is available on your device.

    In general, its not considered a best practice to remove your table as soon as it is empty and re - create it again when you want to add data.  This adds extra overhead fresh for the final, delete and insert first for a given table.  Instead, define and finalize your drawing before you create your table.  Once created, review the static schema.

    That being said, for development purposes, it may be easier to provide an easy way to drop your tables while you develop your schema.

    See you soon,.

    Adam

  • How the values to insert into the table with the command insertion

    Dear all
    can someone tell me how the values to insert into the table with the command insert, I want to say I always use command insert behind my forms on what shutter release button press the button of my save, but today I had a form of 6i, where controls (textbox, combo, etc.) are delineated with directly the table with I guess than the Properties Windows , I created 3 columns in tand 3 text on forms fields, now kindly tell me how to do this fields to fill and do not insert command, I mean directly defined with table column



    Please help me its urgent

    Hello

    If the block is based on your database table, just committed the shape, then changes will be applied to the database.

    François

  • Insert the object into the table

    Hi all

    I would insert my type of object in a table without specifying the name of the variable.

    That's my bad example:

    create or replace type MY_TYPE_OBJ as object 
    (
      val1 number,
      val2 number,
      val3 number
    );
    /
    
    CREATE TABLE MY_TABLE of MY_TYPE_OBJ;
    /
    
    declare 
        myType   MY_TYPE_OBJ;
    begin
    
      myType := new MY_TYPE_OBJ(1, 2, 3);
    
      insert into MY_TABLE values (myType.val1, myType.val2, myType.val3);
      
    end;
    /
    
    

    As you can see, on my last procedure, I had to use the insert into statement with val1, val2, val3 name filed.

    Is there a quicker way to insert an object into a table? In the production environment of the object type that almost 100 filed is not so friendly to write each one by one.

    Thank you

    Federico

    Example:

    SQL> create or replace type TFoo as object(
      2          attr1   integer,
      3          attr2   varchar2(10),
      4          attr3   date
      5  );
      6  /
    
    Type created.
    
    SQL>
    SQL> create table footab of TFoo(
      2          attr1 primary key,
      3          attr2 not null
      4  ) organization index
      5  /
    
    Table created.
    
    SQL>
    SQL> declare
      2          foo     TFoo;
      3  begin
      4          foo := new TFoo( 1, 'test1', trunc(sysdate) );
      5          insert into footab values foo;
      6  end;
      7  /
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select * from footab;
    
         ATTR1 ATTR2      ATTR3
    ---------- ---------- -------------------
             1 test1      2014/08/27 00:00:00
    
    SQL>
    

    I agree though - be careful with tables of objects and now their technical implementation and advantages and disadvantages.

  • Insert xml files into the table

    Hi all

    How to create an application, which allows me to download an xml file and insert the file into a table, looking something like what makes the apex, with 'data-> data-> Data Load XML Workshop'.

    I tried to create it using this link https://forums.Oracle.com/message/9170494 # 9170494

    but when loading the file and send it (current executing the "sp") sends the error "ORA-22285: file for FILEOPEN operation or non-existent directory.

    I could slightly auxiliary

    concerning

    This idea is troubling for me.

    The XML file DOES NOT CHANGE.  This is the goal.  You have a DTD/XST that defines where in the XML hierarchy, a data element is and (so) how to access it.  With this information, you can hardcode things.

    Therefore, you should have no reason for that functionality 'map the data column in the table column"of the data loader since all mappings will be always the same.

    As a simple INSERT... The SELECT statement can (and should) be used.

    (use the FUSION if you update / insert data).

    I copy + paste some of my code in a procedure that I use.

    You will need to replace the parameter name (p_filename) with the value of appropriate link (name of item)

      declare
        l_XML XMLType;
      begin
        /* get file from APEX WWV_FLOW_FILES */
        begin
            select XMLType( blob_content, 1 ) -- 1 means that the file is USACII encoded. this may need to be changed.
              into l_XML
            from wwv_flow_files where name = p_filename; -- replace this with the appropriate ITEM NAME
        exception
          when no_data_found then
            raise_application_error( -20001, 'not in FLOW: ''' || p_filename || '''' );
        end;
    
        /* you'll need to figure this one out */
        INSERT INTO T (...)
        SELECT ..
        FROM  XMLTable( '/'
    pasing l_xml
                columns
                       PATH  -- repeat for each "column" you want to extract
            );
    
       delete from wwv_flow_files where name=p_filename;
      end;
    
  • Could not use DB function call to insert a row into a table OBIEE

    Hello

    At the prompt of the OBIEE report, I create a DB function in a variable column of the guest, so whenever I'm in the dropdown variable ob column call the function DB call.

    The function call is insert a row into a table in the database. However, it seems impossible to insert the row into the table.

    I have test the function in the sqlplus and it works, if the function has no problem. The problem is OBIEE failed to insert something in the datebase, it can only read from it.

    Any ideas on how I could fix it?

    Thank you!

    Hello
    Use your Evaluate function and the variable correctly. In the case where u called this function evaluate in the report in a column, and he has 100 files it contains, it will call db 100 times.

    Kind regards
    Anitha.B

  • How to match columns from two tables with

    Hello:
    I have two tables as below:

    Table1::(Base Table)
    Country | Prefix | Prefix_Length
    Travel | 001 | 3
    CountryB. 0012 | 4
    PaysC | 00443 | 5
    CountryD | 0091 | 4

    :(Detail Table) table2
    The population | Area | Prefix
    500 | AreaA | 0015921
    1000 | AreaB | 00122
    400. AreaC. 00443743
    300. ALIS | 0091333
    100. AreaA | 001

    I need to match these two tables with prefix columns (whose length is not fixed in the two tables: but it starts with 00 in the two tables). Two different countries the prefix may be similar up to a certain length. Thus, Prefix_Length can be used to determine (exactly) how much time should be taken in the search of Table2.

    Output:
    Country | Prefix | Area | Population
    Travel | 001 | AreaA | 600
    CountryB. 0012 | AreaB | 1000
    PaysC | 00443 | AreaC. 400
    CountryD | 0091 | ALIS | 300

    Please help me with your valuable comments.

    -Tender

    Try this

    with base_table as (
                        select 'CountryA' country,'001' prefix,3 prefix_length from dual union all
                        select 'CountryB','0012',4 from dual union all
                        select 'CountryC','00443',5 from dual union all
                        select 'CountryD','0091',4 from dual
                       ),
       detail_table as (
                        select 10 no_of_call,'0015921' prefix from dual union all
                        select 3,'00122' from dual union all
                        select 50,'00443743' from dual union all
                      select 50,'00443643' from dual union all
                        select 300,'0091333' from dual union all
                        select 60,'001' from dual
                       ) 
    
    SELECT  country,
            prefix,sum(no_of_call)
       FROM (
             select  country,
            b.prefix,no_of_call,
            decode(no_of_call,lead(no_of_call,1,0) over(partition by no_of_call order by b.prefix,no_of_call),'y','n') y_or_no
      from  base_table b,
            detail_table d
      where b.prefix = substr(d.prefix,1,prefix_length))
      where y_or_no !='y'
      group by  country,
            prefix
      order by country,
            prefix;
    

    Published by: Vi on 20 February 2012 01:07

  • by comparing the two tables with

    With the help of 10 gr 2

    Assuming that we have two tables with the following structure:
    create table1 (integer id, amount1 number, status varchar2 (200));
    create table2 (integer id, number, status varchar2 amount2 (200));

    Table1 contains a single line:
    ID = 4711, amount1 = 3, status = "not ok".

    Table2 contains one or more lines with table2.id = table1.my_field referenced:
    ID = 4711, amount2 = 2, status = "not ok".
    ID = 4711, amount2 = 2, status = "not ok".
    ID = 4711, amount2 = 1, status = "not ok".
    ID = 4711, amount2 = 4, status = "not ok".

    The amount1 in Table1 is a cumulative sum of Table2 lines what status should be set to "ok". Table1.my_field is particularly well indexed.

    How to make all the lines (for example via the rowid) from Table2 that sum on amount2 is the amount1 in the line after line in Table1 (for switching their table2.status to 'ok')?
    I hope my question is clear enough...

    Try this

     SQL> select * from table2;
    
            ID    AMOUNT2 STATUS
    ---------- ---------- ------
          4711          2 Ok
          4711          2 not ok
          4711          1 Ok
          4711          4 not ok
    
    SQL> roll
    Rollback complete.
    SQL> select * from table1;
    
            ID    AMOUNT1 STATUS
    ---------- ---------- ------
          4711          3 not ok
    
    SQL> select * from table2;
    
            ID    AMOUNT2 STATUS
    ---------- ---------- ------
          4711          2 not ok
          4711          2 not ok
          4711          1 not ok
          4711          4 not ok
    
    SQL>
    SQL>
    SQL> update
      2     table2 a
      3  set
      4     a.status = 'Ok'
      5  where
      6     rowid in
      7       (select t2.rowid
      8       from
      9             (select
     10                     table2.*,
     11                     sum(amount2) over (partition by id order by rn) rn_total
     12             from
     13                     (select table2.*, row_number() over (partition by id order by amount2) rn from  table2 ) table2)  t2,
     14             table1
     15        where
     16             table1.id = t2.id and
     17             t2.rn_total <= table1.amount1)
     18  /
    
    2 rows updated.
    
    SQL> select * from table2;
    
            ID    AMOUNT2 STATUS
    ---------- ---------- ------
          4711          2 Ok
          4711          2 not ok
          4711          1 Ok
          4711          4 not ok
    
    SQL>
    
  • updated line and insert them into another table with trigger.

    Hi guys I have a table that looks like this.
    CREATE TABLE TEST
      (
        "COL1" VARCHAR2(20 BYTE),
        "COL2" VARCHAR2(20 BYTE),
        "COL3" VARCHAR2(20 BYTE)
      )
    I'm going to insert the col1 and col2 values, but I need to get the value of column 3 of table 2 and then insert the complete record in table 3. I love doing that with a trigger. I get an error message and I can't for the life of me figuere out what im doing wrong.
    So here is my nonfunctional trigger.


    Here are the two table

    CREATE TABLE TESTTABLE
      (
        "COLUMN1" NUMBER(15,0),
        "COLUMN2" NUMBER(15,0)
      )
     
    
    Insert into TESTTABLE (COLUMN1,COLUMN2) values (1,5);
    HERE IS THE CODE OF THE TRIGGER
    CREATE OR REPLACE TRIGGER TRIGGER1 
    AFTER INSERT ON TEST 
    FOR EACH ROW 
    BEGIN
      update TEST
      SET COL3 = (SELECT COLUMN2 FROM TEST, TESTTABLE WHERE COLUMN1 = :new.COL1);
    END
    I get an error of trigger mutation that I tried the other iterations of the above but I'm not getting anywhere. I have dumb down my problem at these 3 table.
    Can someone point me in the right direction.

    You'll have to do some reading, but it comes down to process the data on education instead of line level.
    You may even be not at all a trigger.
    See:
    http://www.Oracle-base.com/articles/9i/mutating-table-exceptions.php
    http://asktom.Oracle.com/pls/asktom/asktom.download_file?p_file=6551198119097816936

  • Insert two tables with a single query (same ID)

    Hello

    I want to insert two tables at the same time (with a single request) provided that both records get inserted with the same identifier. How can I do this?
    Table Movies
    id 
    name
    
    Table Category
    movie_id
    cat_type
    (a) insert in the first table, retrieve the id (can be using
    my_sequence.currval
    and then insert into another table.

    question: He brings three queries to the Database, I also suspect that when several people trying to insert there is a problem, I could be wrong.

    I have no other idea.

    Greatly appreciated!

    think you need to do as an anonymous pl/sql block.

    Dim cn As New OracleConnection("DataSource = xx'; user id = xx; password = xx;")
    
    Try
     'build the anonymous pl/sql
     Dim sb as New System.Text.StringBuilder
     sb.Append("declare")
     sb.Append(" l_N number;")
     sb.Append("begin")
     sb.Append("insert into movies (id,name) values (my_sequence.nextval, 'film1') returning id  into l_N;")
     sb.Append( "insert into category values (l_N, 'Category type');")
     sb.Append(" END;")
    
     'create commd object
    
     Dim cmd as New OracleCommand(sb.ToString,cn)
     cmd.Connection.Open()
     cmd.ExecuteNonQuerry()
     cmd.Connection.Close()
     cmd.dispose()
     Catch ex as Exception
    
      blah blah blah
    
    End try
    
      
    

    Published by: pollywog on May 28, 2010 10:48

    Published by: pollywog on May 28, 2010 10:49

  • Insert data into two tables in a single transaction

    Hi all
    I have a problem with the development of features.

    Background:
    I have two tables: OFFER_HEADER and OFFER_CONTENT

    For now, user must insert and commit the OFFER_HEADER (single-row view), then content becomes accessible and OFFER_CONTENT(multi-row view) can be filled. It is done by selecting the save form PRODUCTS and integration of values in OFFER_CONTENT. Product data can be changed on the canvas of CONTENT form.

    My goal:
    I know this isn't a practical way to implement the functionality. I want to insert all the data (header and content) in a single transaction. What is the best way to do it?

    Thanks in advance,
    Best regards
    Bartek

    Hai,

    The error is now with the primary key. In order to check the value of the primary key as part of the operation.

    Kind regards

    Manu.

  • The most effective way to insert form data into multiple tables and w/autonum

    Hi all, this is my first post here. I am new to APEX and PL/SQL. I have ColdFusion and SQL, and I'm used to perform CRUD operations in my CF Tags application files. From what I've read so far, so if this is accurate, it seems that it is more efficient to perform most of the CRUD operations on the database side, I hope that for advice on the best way to accomplish what I ask - even if I'm trying to do is better off in my new APEX application I am open to this information as well.

    I have a form whose data must reside in two tables. Table A is a one-to-one relationship table and stores General information for each request. Table B is a table of one-to-many observations and should store unique records for each type of comment entered on the form, of which there are 3 comment fields on the form, I'd end up with 3 disks in table B for 1 in table A. I am generating an AutoNumber for table A with a sequence and relaxation. I want to do is take the AutoNumber I just created and use it for insertion in the Table B each insertion I have to do. This is where I am stuck.

    I would like to comment on 1) where I should put all these operations and 2) how best to go about what I want to do coding. In ColdFusion, it is as simple as inserting the record in Table A, immediately asking to table A more recent recording and storing (auto) ID in a variable and then using this var for any other table insertions, I had to do. I know it must be at least a little easier in the Oracle world, I just need a nudge in the right direction. Thank you!

    OraclePledge,

    You're pretty close to not having worked with oracle a lot.

    This section is backwards:

    insert into sch.tbl_main(cust_lname,cust_fname,acct_num)
    values(:P3_CUST_LNAME,:P3_CUST_FNAME,:P3_ACCT_NUM);
    
    select "SCH"."TBL_MAIN_SEQ".currval
          into
          v_ID
          from dual;
    

    Even if it will work if you only have a single user, it's a potential bug with two or more users. First select the key (if it's first use nextval rather than currval) can use it in the insert statement.

    See you soon,.
    Janet Tyson

    Published by: Tyson Janet on June 23, 2011 10:48

  • inserting multiple rows of another table with incremented recordid

    Hi all

    I HAVE TWO TABLES:

    CREATE TABLE TEMP_TEST1)
    NUMBER OF RECID,
    TESTCHAR VARCHAR2 (500)
    )

    AND

    CREATE TABLE TEMP_TEST2)
    TESTCHAR VARCHAR2 (500)
    )

    Both the table contains data in it. I want to insert data from TEMP_TEST2 in TEMP_TEST1 with RECID incremented for each record, which must be greater than max (RECID) of TEMP_TEST1.
    PS: I have to query insert only, I cannot make changes in the structure of table or RECID of TEMP_TEST1 is not automatically incremented.
    Please suggest a query that selects the record of TEMP_TEST2 and TEMP_TEST1 insert with recid incremented for each record.


    Thank you.
    SQL> insert into TEMP_TEST2(TESTCHAR)
      2  select 'Test'||level from dual connect by level < 10
      3  /
    
    9 rows created.
    
    SQL>
    SQL>
    SQL> insert into TEMP_TEST1(RECID,TESTCHAR)
      2  select (select nvl(max(RECID),0) from TEMP_TEST1) + rownum, t2.TESTCHAR
      3  from TEMP_TEST2 t2
      4  /
    
    9 rows created.
    
    SQL>
    SQL> select * from TEMP_TEST1
      2  /
    
         RECID TESTCHAR
    ---------- ----------
             1 Test1
             2 Test2
             3 Test3
             4 Test4
             5 Test5
             6 Test6
             7 Test7
             8 Test8
             9 Test9
    
    9 rows selected.
    
    SQL> insert into TEMP_TEST1(RECID,TESTCHAR)
      2  select (select nvl(max(RECID),0) from TEMP_TEST1) + rownum, t2.TESTCHAR
      3  from TEMP_TEST2 t2
      4  /
    
    9 rows created.
    
    SQL>
    SQL> select * from TEMP_TEST1
      2  /
    
         RECID TESTCHAR
    ---------- ----------
             1 Test1
             2 Test2
             3 Test3
             4 Test4
             5 Test5
             6 Test6
             7 Test7
             8 Test8
             9 Test9
            10 Test1
            11 Test2
    
         RECID TESTCHAR
    ---------- ----------
            12 Test3
            13 Test4
            14 Test5
            15 Test6
            16 Test7
            17 Test8
            18 Test9
    
    18 rows selected.
    
    SQL>
    

    Good bye
    DPT

  • Insert a row into the table on a button click

    Hi all

    I have a table called 'temp' with 4 columns such as seq, name, event, id and I have a GP with 3 text such as name, event id fields

    now my question is

    If I enter values in the 3 text fields on this page and a button, click on (for example create), I wanted the values of dose to get inserted into the table 'temp' and

    regarding, "seq" column I HAV created a sequence for it.

    so 1. How to insert values into the table by entering the values in the page

    2 wat shd b made to column seq... (shd b anyth made apex pages or wil automatically get values for each input line)

    pls help me...

    Thanks in advance

    1, it is up to you change your account to something more user-friendly than '8f4692cc-040e-48ee-b102-590cdd4303fc'.

    Then, it would also be a good idea to use proper English when you ask a question here...  Not broken English as "now comes to my" and "wat shd b"... More people will be willing to help you if you at least put forward in order to ask a good question...

    Which version of the database are you using? APEX version?

    Change the code above to this process:

    DECLARE

    v_seq NUMBER;

    BEGIN


    Select SEQUENCE_NAME. NEXTVAL INTO v_seq

    Double;


    INSERT INTO temp (seq, name, event, id)

    VALUES (v_seq,: P1_name,: P1_event,: P1_id);

    END;


    This allows it to be used in older versions of Oracle that do not allow direct access to the sequence.nextval in an assignment statement.


    Thank you


    Tony Miller

    Software LuvMuffin

  • Insert the dbms_output into the table

    Hi all

    I sotre procedure, a paramera IN and OUT matches.
    IN is sending message receiver response of this system, also message to ISO and ISO to another system through the connection.
    With DBMS_OUTOUT. Put_line in Toad, I can see response message.
    How can I save this message in another table?

    Thank you.

    Hello

    You have table where to insert data? What is table DDL?

    Your code might look like, but again, I have all the details

    DECLARE
      msgtoctl    VARCHAR2(32767);
      respfromctl VARCHAR2(32767);
      p_flag      NUMBER;
    BEGIN
    
      msgtoctl    := 'some message';
      respfromctl := NULL;
      p_flag      := NULL;
    
      fcclive.depks_iface_ctl.sendtoctlsocket (msgtoctl, respfromctl, p_flag );
    
      --dbms_output.put_line(p_flag);
      --dbms_output.put_line(respfromctl);
    
      /* insert value from procedure out parameter to table */
      INSERT INTO my_tbl (col1) VALUES (respfromctl);
      COMMIT;
    
    END;
    

    Kind regards
    Jari

    Published by: jarola October 7, 2011 10:38

    BTW, whence this third parameter?
    First of all, you said is the procedure

    PROCEDURE sendToCTLSocket(
      msgToCTL IN VARCHAR2,
      respFromCTL IN OUT VARCHAR2
    )
    

Maybe you are looking for