Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Posts
    52

    Unanswered: is the same code???

    The two next portions code is the same thing , or ono of them is bad???

    This one

    While condition
    insert into table c1,c2,c3,c4 values(v1,v2,v3,v4);
    commit;
    wend;


    While condition
    insert into table c1,c2,c3,c4 values(v1,v2,v3,v4);
    wend
    commit;


    If they are different things, which of them is the best, i mean which has the best performance, speed, and other things???


    Regards

  2. #2
    Join Date
    Apr 2003
    Location
    Minneapolis, MN
    Posts
    273
    I would go for the second one.
    Bhavin

    MS Computer Science
    OCP DBA 9i/8i

  3. #3
    Join Date
    Jan 2004
    Location
    India
    Posts
    191
    can anyone tell me what is WEND?
    Pagnint
    (No need to search web before posting new question)

  4. #4
    Join Date
    Nov 2003
    Posts
    52

    Thumbs up

    Hi paginit:

    Sorry, I should write the PL/SQL code:

    While condition loop
    statements....
    End loop;


    Insterad of the VB code

    While condition
    statements...
    Wend

    Apologizes

  5. #5
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    They are logically different: the transaction sizes are different. If you commit inside the loop, each insert is treated as a transaction; if the program fails on the nth iteration then n-1 records will have been inserted and committed. If you commit after the loop then you have a single transaction; either all records are inserted and committed, or none are.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •