Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Using Oracle bind variables on an INSERT

Using Oracle bind variables on an INSERT

From: Mark Freeman <mark_freeman_at_asc.aon.com>
Date: 16 Jun 2003 19:11:18 -0700
Message-ID: <df323d2.0306161811.3c2b4825@posting.google.com>


I am trying to tune my VB 6 application to take better advantage of the Oracle 8i database it uses.

I have the following code:

    ChangeLog.AddNew

    ChangeLog("USER_ID") = UserID
    ChangeLog("Updated") = Now()
    ChangeLog("EQUIPTYPE_ID") = EquipTypeID
    ChangeLog("EQUIP_ID") = EquipIDOut
    ChangeLog("FIELD_NAME") = FieldName
    ChangeLog("OLD_VALUE") = OldValue
    ChangeLog("NEW_VALUE") = NewValue

    ChangeLog.Update

This code generates sql_text in v$sqlarea like this:

INSERT INTO "TSS_CHANGELOG"
("EQUIPTYPE_ID","EQUIP_ID","FIELD_NAME","OLD_VALUE","NEW_VALUE","USER_ID","UPDATED") VALUES (1,6111,:V00003,:V00004,:V00005,226,:V00007) Somehow, many of the values are being converted to bind variables without my doing anything. I'd like to take out the middleman and do all of them so I end up with one such query in the cache rather than the thousands that I found. Is this the proper syntax to do what I want:

gcnnOut.Execute "INSERT INTO 'TSS_CHANGELOG' ('EQUIPTYPE_ID','EQUIP_ID','FIELD_NAME','OLD_VALUE','NEW_VALUE','USER_ID','UPDATED') VALUES (:a,:b,:c,:d,:e,:f,:g,:h,:i) using " & EquipTypeID & "," & EquipIDOut & "," & FieldName & "," & OldValue & "," & NewValue & "," & UserID & ",SYSDATE"

Thanks for your guidance,

Received on Mon Jun 16 2003 - 21:11:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US