Generate the command Id and insert data into two different tables: oracle apex 5.0

I have three tables. name of the tables: PRODUCT, ORDER_HEADER, ORDER_DETAIL. I took REPORT inter ASSETS in which the VALUES from TABLE product. I need to use the trigger here, there is a TEXT ARTICLE called ORDER ID: it will generate through trigger. so whenever new order placed order id must be unique. There is a button when this button is clicked, the VALUES of REPORT must be inserted in to ORDER_HEADER , ORDER_DETAIL (in fact, I am in confusion is it even possible).

I tried to create the trigger: not work if


CREATE OR REPLACE TRIGGER "EMP_TRG1".

Before Insert on order_header

for each line

Start

If: new. Order_ID is null

then

Select lpad (demo_seq.nextval, 8, '0'): new. Order_ID order_header;

end if;

end;

SQL:

Select

apex_item. Text(1,p.PRODUCT_ID) PID.

PN.product_name,

apex_item. Text(2,p.PRODUCT_QTY) qt.

apex_item. Text(3,p.unit_price) upward,

apex_item. Text(4,p.TOTAL_AMOUNT) am

OMS_SHIP_CART_DETAIL p, pn OMS_PRODUCT

where p.product_id = pn.product_id

DA:

var arr_f01 = [];

var arr_f02 = [];

var arr_f03 = [];

var arr_f04 = [];

var arr_f05 = [];

product_id var;

unit_price var;

Var Qty;

var total_1;

() $("input[name='f01']").each

function() {}

product_id = $(this).closest('tr') .children ('td [headers = 'PID']') .text ();

unit_price = $(this).closest('tr') .children ('td [headers = "Uprice"]') .text ();

Qty = $(this).closest('tr') .children ('td [headers = "Qty"]') .text ();

total_1 = $(this). Closest ('tr'). Children ('td [headers = "total"]'). Text();

arr_f01.push ($(this).) Val());

arr_f02.push (product_id);

arr_f03.push (total_1);

arr_f04.push (unit_price);

arr_f05.push (Qty);

}  );

(apex). Server.Process

"Insert a command."

, {f01: arr_f01, f02: arr_f02, f03: arr_f03, f04: arr_f04, f05: arr_f05}

}

, {dataType: "text", success: function (pData) {alert ('added product') ;}}

);

Ajax callback:

declare

l_count number;

Start

-insert into OMS_ORDER_HEADER (USER_ID, TOTAL_AMOUNT, batch, ORDER_DATE) values(:P1_USER_ID,:P42_TOTAL,'PENDING',SYSDATE);

I'm looping 1.apex_application.g_f01.count

insert into OMS_ORDER_DETAIL (PRODUCT_ID, UNIT_QTY, UNIT_PRICE, TOTAL_AMOUNT)

values (APEX_APPLICATION. G_F01 (i), APEX_APPLICATION. G_F03 (i), APEX_APPLICATION. G_F04 (i), APEX_APPLICATION. G_F05 (i));

commit;

end loop;

end;

Hi Dominique,.

I create a process page away present in your application

declare
  l_order_id varchar2(8);
begin
  insert into order_header(ORDER_ID
                        , STATUS
                        , ORDER_DATE)
                  values(lpad(demo_seq.nextval,8,'0')
                        , 'Pending'
                        , sysdate)
  returning ORDER_ID into l_order_id; 

  for rec in(select ID
                  , QTY
                  , PRICE
              from product)
  loop 

    Insert Into Order_Detail ( ORDER_ID
                              , PRODUCT_ID
                              , QTY
                              , UNIT_PRICE)
                        Values(l_order_id
                              , rec.id
                              , rec.qty
                              , rec.price); 

    commit;
  end loop;
end;

Please check and let me know.

Kind regards

Jitendra

Tags: Database

Similar Questions

  • Reading file from the ftp server and importing data into the table

    Hi experts,

    Well, basically, I text with different layout files have been uploaded to an ftp server. Now, I must write a procedure to recover these files, read and insert data into a table... what to do?

    your help would be greatly helpful.

    Thank you

    user9004152 wrote:
    http://it.Toolbox.com/wiki/index.php/Load_data_from_a_flat_file_into_an_Oracle_table

    See the link, hope it will work.

    It is an old method, using the utl_file_dir parameter that is now obsolete and which is frankly a waste of space when external tables can do exactly the same thing much more easily.

  • Read the BLOB and insert data into a table

    Hi all

    Let us examine below on Oracle DB 12 c:

    create table xx_test3 (c blob);
    
    insert into xx_test3 (c) values (utl_raw.cast_to_raw(
    'azertyuiop,qsdfghjklm,wxcvbn'));
    
    
    create table xx_target (col1 varchar2(50));
    
    
    
    

    Can someone guide me how to read the data and insert it into the xx_target table?

    Necessary result is:

    
    select * from xx_target;
    
    
    COL1                                              
    
    --------------------------------------------------
    azertyuiop                                        
    qsdfghjklm                                        
    wxcvbn                                            
    
    3 rows selected.
    
    
    
    
    

    Thanks in advance,

    Stoyanov.

    insert into xx_target (col1)

    with the data as)

    Select utl_raw.cast_to_varchar2 (dbms_lob.substr (c, 32000, 1)) CBC

    of xx_test3

    )

    Select regexp_substr (CBC, ' [^,] +', 1, level)

    from the data

    connect by level<= regexp_count(src,="" ',')="" +="">

  • I want to loop through the data from two different tables using for loop where the query should be replaced at runtime, please help me

    I have the data into two table with the structure of similar column, I want to loop through the data in these two tables

    based on some condition and runtime that I want to put the query in loop for example, the example is given, please help me

    create table ab (a number, b varchar2 (20));

    Insert into ab

    Select rownum, rownum. "" sample "

    of the double

    connect by level < = 10

    create table bc (a number, b varchar2 (20));

    Insert into BC.

    Select rownum + 1, rownum + 1 | "" sample "

    of the double

    connect by level < = 10

    declare

    l_statement varchar2 (2000);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: =' select * ab ';

    on the other

    l_statement: =' select * from bc';

    end if

    I'm in execute immediate l_statement - something like that, but I don't know

    loop

    dbms_output.put_line (i.a);

    end loop;

    end;

    Something like that, but this isn't a peace of the code work.

    Try this and adapt according to your needs:

    declare

    l_statement varchar2 (2000);

    c SYS_REFCURSOR;

    l_a number;

    l_b varchar2 (20);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: = "select a, b, AB;

    on the other

    l_statement: = "select a, b from bc;

    end if;

    --

    Open c for l_statement;

    --

    loop

    extract the c in l_a, l_b;

    When the output c % notfound;

    dbms_output.put_line (l_a |') -' || l_b);

    end loop;

    close c;

    end;

    /

  • How to get into two different tables in two columns of a listbox of multi column

    Hi all

    I have two different tables of the values assume that table 1A (1,2,3,4,5) and another table B (3,4,5,6,7). I want to write these tables in a multicolumn listbox such as 1st column would be A array and 2nd column table B.

    Thnx in advance

    Saki,

    I hope this helps to further

  • Select Max (Date) in two different tables...

    Dear all,

    I need the date of last update of two different tables, I mean max (date). We will update one table at a time. Updated once I need to take the last update.

    It can be either in table A table B.

    for example.

    Table A

    Date of the ID

    100 16/05/2014

    101 20/05/2014

    102, 22/05/2014

    Table B

    Date of the ID

    100 04/06/2014

    101, 26/05/2014

    102 21/05/2014

    I need the date of table B (101 26/05/2014) last updated date...

    Hello

    Another way, using much more GRAND:

    SELECT LARGER (max1, max2) x

    FROM (SELECT MAX (mydate) max1

    OF mytable_a

    )

    (SELECT MAX (myotherdate) max2

    OF mytable_b

    )

    ;

    Best regards

    Bruno Vroman.

  • inserting data into a temporary table

    I want to do something like session and I decided to use the temporary table. But when I try to insert data that has no past. This is my trigger when-pressed key code:


    declare

    total_col number (18.0);
    varchar (100) of the author.
    title varchar (200);
    price number (18.0);


    Start
    Select BOOK_AUTHOR, BOOK_TITLE, BOOK_PRICE by author, title, price from BOOKS where BOOK_ID =: BOOKS. BOOK_ID;
    insert into orders_tmp (author, title, price) values (author, title, price);
    commit;

    Select total in total_col total_amount where t_id = (select max (t_id) total_amount);
    : SUB_CATEGORY. AMOUNT: = total_col;
    end;

    the first line of the selected data of the block, 2nd insert into the temporary table. 4th line selected the last column in a temporary table and dispalying in etiquette. When the trigger is activated, I have an ORA-01403 error.
    Help, please.

    Edited by: 863470 2011-09-06 06:50

    I decided to use the temporary table

    Can you show how you created your temporary table (ie., show us your DML Table statement)? Without knowing how you have set your temporary table, we can really offer you suggestions. ;)

    declare
    

    total_col number (18.0);
    varchar (100) of the author.
    title varchar (200);
    price number (18.0);
    Start
    Select BOOK_AUTHOR, BOOK_TITLE, BOOK_PRICE by author, title, price from BOOKS where BOOK_ID =: BOOKS. BOOK_ID;
    insert into orders_tmp (author, title, price) values (author, title, price);
    commit;

    Select total in total_col total_amount where t_id = (select max (t_id) total_amount);
    : SUB_CATEGORY. AMOUNT: = total_col;
    end;

    This is more work than it should be. A much simpler and more elegant method is:

    /* Sample When-Button-Pressed trigger */
    BEGIN
       INSERT INTO orders_tmp (author, title, price)
       SELECT BOOK_AUTHOR, BOOK_TITLE, BOOK_PRICE
         FROM BOOKS
        WHERE BOOK_ID = :BOOKS.BOOK_ID;
    
       ... Rest of your code here...
    END;
    

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

  • Look for patterns in a string and insert it into a new table

    I need to write a query that finds a number of location of employees that has been changed from old to new

    EMPLOYEE_DESC

    Description of the ID

    1 employee location was change from 877-287-8765 to 876-876-0976

    2 location of employee was passing of 877-287-8766 at 876-879-0976

    slot 3 is passed under NONE FOUND TO577-75-5951

    Once I get the identifier for the old and the new, I need to insert into the new table

    INSERT INTO TABLE_B

    (OLD_LOC_ID, NEW_LOC_ID)

    VALUES (OLD_LOC_ID, NEW_LOC_ID);

    TABLE_B

    ID OLD_LOC_ID NEW_LOC_ID

    1 287-877-8765 876-876-0976

    2 287-877-8766 879-876-0976

    3. NONE FOUND 577-75-5951

    The problem is that there is no fixed model for these records. I guess I have to insert the records that correspond to a fixed patten and snoop then through other manually. Is there a REGULAR expression feature that can help me grep values old and new location for the employee_desc number?

    Thank you

    Kevin

    Hello

    Kevin_K wrote:

    ...  The problem is that there is no fixed model for these records. I guess I have to insert the records that correspond to a fixed patten and snoop then through other manually. Is there a REGULAR expression feature that can help me grep values old and new location for the employee_desc number?

    Thank you

    Kevin

    Yes, you can do something like this:

    REGEXP_SUBSTR (description

    , ' ((NONE FOUND) |) (\d+-\d+-\d+)) * To * \d+-\d+-\d+'

    1

    1

    'i' - case-insensitive

    )

    It looks like for

    1. a "phone number" or the words "NOTHING FOUND", followed immediately by
    2. 0 or more spaces followed immediately by
    3. the word "TO", followed immediately
    4. 0 or more spaces followed immediately by
    5. a "phone number".

    where a "phone number" is defined as

    1. 1 or more digits, followed immediately
    2. a hyphen, immediately followed by
    3. 1 or more digits, followed immediately
    4. a hyphen, immediately followed by
    5. 1 or more digits
    6. You can also get the parts before and after 'TO' separately.
  • How can I select the first date (at least) and the corresponding date of two different tables source?

    I have 2 tables, INVOICE and INVOICE_REFNUM similar to below. I'm writing a query that withdrawing the first date (less) for a single record remaining the two tables. Each table records the receipt of invoices, but according to the source of the received invoice some may reside in INVOICE_REFNUM and others the INVOICE table. I also use DECODE on the topic of INVOICE_SOURCE, when the date less is taken from the INVOICE table that contains that field, so if the date is in the field INVOICE_REFNUM DECODE is not necessary. Example:

    INVOICE (table)

    INVOICE_GID INVOICE_SOURCE INSERT_DATE

    ABC. AVRT123 I HAVE 11/03/2012-15:49:32

    ABC. CNWY234 G 12/03/2012 14:07:30

    ABC. UPGF678 M 15/03/2012 20:21:54

    INVOICE_REFNUM (table)

    INVOICE_GID INVOICE_REFNUM_QUAL INVOICE_REFNUM_VALUE INSERT_DATE

    ABC. AVRT123 SOURCE ACS 11/03/2012 14:49:32

    ABC. CNWY234 SOURCE CSA 12/03/2012 13:07:30

    ABC. UPGF678 SOURCE ACS 15/03/2012 21:21:54

    My decode statement is: DECODE ("INVOICE_SOURCE, 'I', 'IDE', 'G', ' Auto-Pay", ', 'Manual')

    If I were to write a query on these two tables, the output will resemble the following:

    INVOICE_GID INVOICE_SOURCE INSERT_DATE

    ABC. AVRT123 ACS 11/03/2012 14:49:32

    ABC. CNWY234 ACS 12/03/2012 13:07:30

    ABC. UPGF678 Manual 15/03/2012 20:21:54

    I worked on it for 2 days, and I was able to pull a date by using the following SQL code, but cannot determine how to extract the corresponding source:

    SELECT THE LEAST (GLOGOWNER. INVOICE_REFNUM. INSERT_DATE, GLOGOWNER. THE INVOICE. INSERT_DATE) AS 'DATE OF THE INVOICE.

    GLOGOWNER. THE INVOICE. INVOICE_GID,

    DECODE (GLOGOWNER. THE INVOICE. INVOICE_SOURCE, 'I', 'IDE', 'G', 'Auto-Pay', ', 'Manual').

    GLOGOWNER. INVOICE_REFNUM. INVOICE_REFNUM_VALUE

    OF GLOGOWNER. INVOICE

    LEFT JOIN GLOGOWNER. INVOICE_REFNUM

    ON GLOGOWNER. THE INVOICE. INVOICE_GID = GLOGOWNER. INVOICE_REFNUM. INVOICE_GID

    WHERE GLOGOWNER. INVOICE_REFNUM. INVOICE_REFNUM_VALUE = "ACS."

    AND GLOGOWNER. INVOICE_REFNUM. INVOICE_REFNUM_QUAL_GID = 'SOURCE '.

    AND GLOGOWNER. THE INVOICE. INVOICE_TYPE = 'I '.

    ORDER OF GLOGOWNER. THE INVOICE. INVOICE_GID

    Any help is greatly appreciated!

    Best regards

    -Adam

    Hello

    Is that what you want?

    SELECT i.invoice_gid

    CASE

    WHEN ir.insert_date<= i.insert_date ="" then ="">

    WHEN i.invoice_souce = 'I' and THEN 'EDI '.

    WHEN i.invoice_souce = 'G' THEN 'debit '.

    WHEN i.invoice_souce = am' THEN 'manual '.

    END AS invoice_source

    , The LEAST (i.insert_date, ir.insert_date) AS insert_date

    I have the Bill OF

    JOIN invoice_refnum ON i.invoice_gid = ir.invoice_gid ir

    WHERE ir.invoice_refnum_value = 'ACS '.

    AND ir.invoice_refnum_qual_gid = 'SOURCE '.

    AND i.invoice_type = 'I '.

    ORDER BY i.invoice_gid

    ;

    There is no reason to do an outer join if you only want the lines with specific values anyway.

    What happens if the 2 tables have exactly the same invoice_date?  The query above takes the invoice_source of invoice_refnum in this case, but that can easily be changed.

    Or the other of the insert_dates can be NULL?

    I hope that answers your question.

    Otherwise, thank you post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also after the results you want from these data (otherwise what you have already posted).

    Explain, using specific examples, how you get these results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

  • READ the events when you insert data into a CLOB to waiting

    Hello people,

    I too read waiting for IO (db file sequential read) on a CLOB, when data is inserted, and I don't understand why.

    Statement:
    INSERT into TABLE (< all columns list >) values < list of all values >;

    Duration:
    between 250ms and 500ms, so much is too long by far

    Location:
    * Database 11 GR 2 (11.2.0.3.0) Standard Edition on Linux (OEL 5) x86_64
    * Usually, I have about 200 of these inserts in a single transaction. Thus, generally such a transaction is open for at least 50 seconds.
    * This is an OLTP environment, so I can't drop indexes or constraints 'before' loading, in fact I'm loading and reading the table all the time.
    * Insertion happens simultaneously by multiple Java threads, all in France via JDBC thin driver.
    * The table is not partitioned (Standard Edition).
    * The table contains < 7 million lines.
    * I can't ADD, because the table is served in a logical way, and I do not have maintenance windows to rearrange segments.
    * There are a lot of NON NULL and check constraints simple insertion-value based on the table, but only SINGLE (as part of the numeric primary key) constraint.
    A column is a CLOB, but there is no constraint on the CLOB column.

    What I have done:
    Raised the execution plan. Here it is:
    ------------------------------------------------------------------------------------------------------------
    | ID | Operation | Name | Begins | Cost | A - lines. A - time | Pads | Bed | Written |
    ------------------------------------------------------------------------------------------------------------
    | 0 | INSERT STATEMENT. 1. 1. 0 | 00:00:02.75 | 5064 | 840. 2.
    | 1. LOAD TABLE CONVENTIONAL | 1 | | 0 | 00:00:02.75 | 5064 | 840. 2.
    ------------------------------------------------------------------------------------------------------------

    I tried to find out where all this runtime will, so I enabled level 12 10046 for this SQL tracing and tkprof analysis shows:

    Elapsed time are waiting on the following events:
    Event waited on times max wait for the Total WHEREAS
    ----------------------------------------   Waited  ----------  ------------
    DB file sequential read 61 0.01 0.29
    direct path write 30 0.01 0.00
    direct path read 15 0.00 0.00

    = > So now I know where my runtime is spent on: reading!

    The raw trace file says:

    WAITING #139690535902720: nam = 'db file sequential read' ela = 8514 file No. = 5 block #= blocks 16950925 = 1 obj #= tim 84425 = 1354644922207564
    WAITING #139690535902720: nam = "Write direct path" ela = 376 of file = 5 first dba = 16956449 block cnt = 1 obj #=-1 tim = 1354644922208331
    WAITING #139690535902720: nam = 'db file sequential read' ela = 321 file #= 5 block #= blocks 16956449 = 1 obj #= tim 84425 = 1354644922208727
    WAITING #139690535902720: nam = "direct path read" ela = 216 number of file = 5 first dba = 16956449 block cnt = 1 obj #= tim 84425 = 1354644922208998
    WAITING #139690535902720: nam = "Write direct path" ela = 375 folder = 5 first dba = 16956449 block cnt = 1 obj #= tim 84425 = 1354644922209458
    WAITING #139690535902720: nam = 'db file sequential read' ela = 5471 file #= 5 block #= blocks 8907590 = 1 obj #= tim 84422 = 1354644922215025
    EXEC #139690535902720:c = 2999, e = 18440, p = 4, cr = 14, cu is 38, SIG = 0, r = 1, dep = 0, og = 1, plh = 0, tim = 1354644922215246
    "STAT #139690535902720 id = 1 cnt = 0 pid = 0 pos = 1 obj = 0 op ='LOAD TABLE CONVENTIONAL (cr = pr 14 = 4 pw = 2 time = 16415 US)"
    OUTCOME #139690535902720:c = 0, e = 17, dep = 0, type = 1, tim = 1354644922216200

    obj #= 84425 is my CLOB


    Now my question:
    Why my reading INSERT a CLOB so heavily when inserts a row of data in my table?
    I wasn't able to find out, please share your thoughts.
    If you need more/other information, let me know.

    I thank very you much in advance!

    Best regards
    Martin Klier
    Principal, s/n

    Please check MOS note:
    Insert a LOB has bad performance; ARM reads in the Top 5 of the wait events [ID 1291494.1]

  • 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.

  • Insert data into another database with a script

    Hello.

    What is the best way to insert data into one database with a script

    INSERT INTO BF_PRUEBASMTP.bf_mtp_agr_inscription (ain_agreementid, ain_customerid, ain_paymethodsid, ain_servicemoduleid, referencia)

    SELECT AAG. AAG_AGREEMENTID, ACU. ACU_CUSTOMERID, 2, 2, ins. NUMERO_REFERENCIA

    OF BF_PRUEBASMTP.bf_mtp_agr_biller ABI

    JOIN IN-HOUSE

    BF_PRUEBASMTP. BF_MTP_AGR_AGREEMENT AAG ON ABI. ABI_BILLERID = AAG. AAG_BILLERID

    INNER JOIN 'CLIENTEUNICO. ALMUERZO" ins

    ON THE AAG. AAG_AGREEMENTID = ins. CONVENIOID

    INNER JOIN BF_PRUEBASMTP.bf_mtp_agr_customer ACU

    ON ACU.acu_typedocumentid = ins. TIPO_DOCUMENTO

    AND ACU.acu_numberid = ins. NUMERO_DOCUMENTO;

    CLIENTEUNICO. INSCRIPCIONES = SELECT * DE INSCRIPCIONES - to a DIFFERENT DATABASE


    Thank you very much.

    2931095 wrote:

    If I don't have permissions to create a database link. Is there another way to do this?

    Thank you.

    link to database IS the method by which an Oracle database accesses to a different database.

    If you are the ADMINISTRATOR, you should have permission.

    If you are not the ADMINISTRATOR, you should not have permission and need to talk to the ADMINISTRATOR that is allowed.

  • Insertion of records in two different tables at the same time?

    Hello everyone, I have question about inserting records in two different tables at the same time, I'm looking for is by the way a unique id, which is created in the first statement insert to the second insert statement. Example of this problem:

    < cfquery name = "addRecords1" datasource = 'test' >

    Insert Into Table1 (name, Date, age)

    Values (< cfqueryparam cfsqltype = "cf_sql_char" value = "#arguments.) "Name # ' >.

    < cfqueryparam cfsqltype = 'cf_sql_date' value = '#arguments. "Date # ' >.

    < cfqueryparam cfsqltype = "cf_sql_int" value = "#arguments. Age #"(>); "

    Select SCOPE_IDENTITY() as RecID;

    < / cfquery >

    < cfquery name = "addRecords2" datasource = 'test' >

    Insert into Table2(Company,City,Date,ID)

    Values (< cfqueryparam cfsqltype = "cf_sql_char" value = "#arguments.Company #" >,)

    < cfqueryparam cfsqltype = "cf_sql_char" value = "" #City # ">,"

    < cfqueryparam cfsqltype = 'cf_sql_date' value = "" #Date # ">,"

    ( < cfqueryparam cfsqltype = "cf_sql_int" value = "How to pass RecID to insert in this table?" >).

    < / cfquery >

    In this example, I'm inserting records in table 1 and creation of IDENTITY SCOPE as RecId. I would like to pass this id and insert it in my table 2. This Id, I'll use in my second table as an identifier. If anyone knows anything about this please let me know. Thank you.

    );
    

    QueryName - DOT - ColumnName, so it should be:

    );
    

    HTH,

    ^_^

  • Get the date value. MinValue and insert it into the DB

    Hello

    I'm developing an adf application using jdev11g.

    I need to recover the 3 values of page jsf (inputText 2 + 1 date. MinValue) and insert them into DB

    so I create a method in appModuleImpl:

    {public createAffAgVehNewRow (Date date, around km, veh Integer) Sub

    Get the id of the current user

    String ag = ADFContext.getCurrent () .getSessionScope ().get("idAg").toString ();

    getSequenceNumber

    oracle.jbo.domain.Number seq = new oracle.jbo.domain.Number (0);

    SequenceImpl seqImpl = new SequenceImpl ("AFF_AV_SEQ", getDBTransaction());

    SEQ = seqImpl.getSequenceNumber ();

    Insert values into the DB table

    Line r = getAffAgVehView1 () .createRow ();

    ViewObjectImpl vo = this.getAffAgVehView1 ();

    r.setAttribute ("IdAg", Integer.parseInt (ag.toString ()) ");

    r.setAttribute ("IdAffAv", seq);

    r.setAttribute ("KmDep", km);

    r.setAttribute ("IdVeh", veh);

    r.setAttribute ("DateAff", date);

    r.setAttribute ("KmArriv", null);

    r.setAttribute ("ConsoCarb", null);

    vo.insertRow (r);

    this.getDBTransaction () .commit ();

    }

    also, I changed the default value of the EO (AffAgVeh) to adf.currentDate () and the user interface as simpleDate format: "MM/DD/YYYY.

    the problem as whene I enter 3 inputValues and click on the button I get this message:

    Timestamp format must be yyyy-mm-dd hh: mm: [.fffffffff]

    someone knows how to solve this problem

    Thank you

    Mark

    Hi Dev

    Please pass.

    java.sql.SQLException: column type invalid in the adf

    Thank you

    Subramanian M

  • Cannot insert data into the database

    Hello world

    I stuck with a problem in DB juice. When I try to insert data into the database using DB tool, I get a repeated error message (error 1). Please find the my vifile below and solve say.

    Problem is use Labiew 8.2. So try to answer accordingly

    Try it with a cluster instead of a string or an array.

Maybe you are looking for

  • Laptop overheating after 20 minutes of use

    My 2011 laptop gets very hot if I use longer than 20 minutes approximately.  I don't know what this means and what I need to do

  • PowerBook G3 battery

    Guys I need help. There are several sellers on eBay, but nowhere it says it is compatible with my powerbook, which is PDQ (wallstreet?) 300 mhz. All I got is compatible with the 1998 model, which is my PowerBook. I don't want to waste money if it doe

  • temorary transfer my Skype account on new computer

    I have a Skype account on my laptop, in need of major repairs, and I want to temporary put my account on my desk, I hope that this does not that mean from a new account.

  • How dual boot ubuntu and windows 8?

    HP envy 6 sleekbook 6z 1100 I already turn off secure in the BIOS startup But I can not install ubuntu 13.04 The installation was smooth and good But after the reboot, there is no start menu doesn't appear for me to choose what operating system I wan

  • packs battery continues to charge iPhone 5 when he goes to sleep - that's my phone?

    I bought a second hand iPhone 5, knowing that he didn't hold a long charge (I was told 4 hours, but between the delivery of the money and go home 45 minutes, she went from 100% of deaths).  No problem, I'll buy a battery pack. Got a Farbe Technik, a