Defining A DataBase Transaction

Results 1 to 2 of 2

Thread: Defining A DataBase Transaction

  1. #1
    Join Date
    Dec 1969

    Default Defining A DataBase Transaction

    I have a script where I execute from 1 to many INSERTs into an ORACLE table.(Sometimes as many as more than 60). If for any reason, the script terminates prematurely(that is gets killed), only some of the INSERTs have happened. I would prefer all or none.<BR> Is there any way to tell ORACLE:<BR> 1-This is the beginning of a "transaction"<BR> 2- INSERT<BR> INSERT<BR> INSERT<BR> INSERT<BR> INSERT<BR> etc<BR> 3-This is the end of the "transaction"<BR><BR> so that none of the INSERTs "take" unless 3(this is the end) has happened. <BR> If so please show me with a complete example as I ma not extremely SQL savvy.<BR>

  2. #2
    Shinto Guest

    Default RE: Defining A DataBase Transaction

    Try this out..<BR><BR>&#060;%<BR> set conn = Server.Createobject("ADODB.COnnection")<BR> DSN<BR> conn.BeginTrans<BR> sql1 = " write the query "<BR> sql1 = " write the query "<BR> .<BR> .<BR> sqln = " write the query "<BR><BR> conn.execute(sql)<BR> error = conn.errors.count<BR> if error = 0 then<BR> conn.committrans<BR> else<BR> conn.rollbacktrans<BR> end if<BR> conn.close<BR>%&#062;<BR>

Posting Permissions

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