now,I want to insert some data to the sybase database, some variable such as i,j,k,name,k,j I have defined before. I write the sql statement here But I meet some errors,How to write this nested String for sql query? For example:
import Sybase db = Sybase.connect('boyee','sa','',"test'') c = db.cursor()
...... >>> values = "%d,%d,%d,%s,%d,%d" % (i,j,k,name,k,j) >>> c.execute("'insert into productinfo(productid,spid,corpid,productname,type1, type2) value(@value)',{'@value':values}") Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\Python24\lib\site-packages\Sybase.py", line 774, in execute self.description = fetcher.start(self.arraysize) File "C:\Python24\lib\site-packages\Sybase.py", line 517, in start return self._start_results() File "C:\Python24\lib\site-packages\Sybase.py", line 645, in _start_results self._raise_error(Error, 'ct_results') File "C:\Python24\lib\site-packages\Sybase.py", line 506, in _raise_error raise exc(text) Sybase.Error: ct_results Any reply is enjoyable,Thank a lot!
-- http://mail.python.org/mailman/listinfo/python-list