[Zope] execute parameters sql in script

Michael Bleijerveld michael at bleijerveld.nl
Thu Sep 18 03:42:57 EDT 2003


Hi,

When executing the following script with parameters user1 and password1 I
receive a error message.

import kinterbasdb,sys

con = kinterbasdb.connect(
    dsn='test.gdb',
    user='sysdba', password='masterkey'
  )

# Get a Cursor object that operates in the context of Connection con:
cur = con.cursor()

# Execute the SELECT statement:
str_sql = "insert into users values (" + sys.argv[0] + ", "+ sys.argv[1] +
",)"
cur.execute(str_sql)

# Retrieve all rows as a sequence and print that sequence:
print cur.fetchall()

It seems to be to SQL string but I am not sure. Any suggestions.


Regards.

Michael





More information about the Zope mailing list