Updating SQL table problems with python

DJ dj3000 at iinet.net.au.nospam
Wed Jun 4 04:24:30 EDT 2003


Realised when posting this that title value is misspelt
That was not the error though :)

"DJ" <dj3000 at iinet.net.au.nospam> wrote in message
news:3eddac41$0$31519$5a62ac22 at freenews.iinet.net.au...
> Hi there,
>
> I get a Syntax error from this following SQL statement:
>
> file_open = urllib.urlopen(url)
> xmldoc = minidom.parse(file_open)
> file_open.close()
> blah = xmldoc.toxml()
> title = minidom.parseStrin(blah).getElementsByTagNam('title')
>
> connection = gadfly.gadfly("portal", "dbase")
> cursor = connection.cursor()
> for x in title:
>         j = x.firstChild.data
>         j = j.encode('ascii', 'replace')
>         cursor.execute("update items set title = '%s' where title =
'Title'"
> % j)
>         connection.commit()
>
> As you can tell, im parsing a xml RSS feed and updating items table. Im
> trying to replace
> default value of 'Title' with the title from the RSS feed.
> The update statement is givng me the syntax error
> I cant see whats wrong
>
> Need some help
> Thanks in advance
> Adam
>
>






More information about the Python-list mailing list