Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LS:DO-ODBC to connect to DB2 table and insert a row

Status
Not open for further replies.

Foote

Programmer
Mar 29, 2001
19
US
I am connecting to a DB2 table using odbc in lotusscript.
I am using lotusscript to loop through a collection of documents in a notes database, saving data from several fields to temporary variables and then trying to insert a row into a db2 tble using those temporary variables.

My error message when I execute the qry is that dynamic variables cannot be used in the qry statement.
Is there a way to get around this?
my temporary variable is defined:
tpincode = doc.Pin1(0)
here is my qry statement:
qry.sql = "INSERT INTO WOWTB.FR_PIN_CODE VALUES(111111, :tpincode, '2004-07-30', '0000', '1111-11-11-11.11.11.111111')" Thanks....
 
you're not structuring your query correctly:

qry.sql = "INSERT INTO WOWTB.FR_PIN_CODE VALUES(111111, " + tpincode + ", '2004-07-30', '0000', '1111-11-11-11.11.11.111111')"

result.Execute

Leslie
 
Leslie,
Thanks so much! My qry is now working. I couldn't find documentation anywhere on using the + signs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top