ODBC question from Python Newbie
Bjorn Pettersen
BPettersen at NAREX.com
Thu May 10 13:23:01 EDT 2001
> From: uncleleo [mailto:uncleleo at billsfan.net]
>
> I was attempting to insert a row into a Microsoft SQL server
> table. Using
> the Sam Rushing's ODBC with DynWin. Inside this table are 3
> fields and all
> of them varchars. One of the fields was intended to hold a
> root directory,
> e.g. c:\service\system.py.
>
> >>> sql.query('insert into app..application (Designator,
> Script) values
> (8885551212, c:\\service\\test.py)')
> 37000
> [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1:
> Incorrect syntax near
> 'c:'.
> native error 170
>
> This one errors.
[etc.]
Sql strings need to be in single quotes:
sql.query("""insert into app..application
(Designator, Script)
values
(8885551212, 'c:\\service\\test.py')
""")
-- bjorn
More information about the Python-list
mailing list