Re: difference between statements

[email protected]
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <OF82F3520C.091613B6-ON852572AC.0040D6B1-852572AC.0041479F@bankofny.com>
I very rarely work directly in sqlite, but Deletes and Inserts have to
have a con.commit() after them.

Also you may be having a problem which I have experienced, if a query
contains parentheses then paremeter substitution fails. In other words
if I have a query like this:

cur.execute("""select * from Products where ProductID = (select
ProductID from Sponsor where SponsorID = ?)""", (12,))

This will fail, however if a do something like this:

sql = """select * from Products where ProductID = (select ProductID from
Sponsor where SponsorID = %d)""" % 12

Hope this helps.

Thanks,

Greg Givler
Information Technology
Lockwood®
10 Valley Stream Parkway
Malvern, PA 19355
Phone: (484) 605-4826
Email: [email protected]


                                                                                                                                           
                      "Eric S. Johansson"                                                                                                  
                      <[email protected]>             To:       "For users of the pysqlite database module." <pysqlite-IAPFreCvJWPBWskQ1e/[email protected]>       
                      Sent by:                     cc:                                                                                     
                      pysqlite-bounces@list        Subject:  [pysqlite] difference between statements                                      
                      s.initd.org                                                                                                          
                                                                                                                                           
                                                                                                                                           
                      03/28/2007 02:19 AM                                                                                                  
                      Please respond to                                                                                                    
                      "For users of the                                                                                                    
                      pysqlite database                                                                                                    
                      module."                                                                                                             
                                                                                                                                           
                                                                                                                                           




works: sqlite> DELETE FROM external_internal WHERE (internal_ID='esj');

does not work in pysqlite
del_cmd  = "DELETE FROM external_internal WHERE (internal_ID='esj');"
no action

del_cmd  = "DELETE FROM external_internal WHERE (internal_ID=esj);"
pysqlite2.dbapi2.OperationalError: no such column: esj

so, what is the difference between these three?  also ? param and :foo
substitutes also failed.

huh?  makes no sense to me.

--
Speech-recognition in use.  It makes mistakes, I correct some.
_______________________________________________
pysqlite mailing list
pysqlite-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/pysqlite

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please call the help desk at ext 4850
______________________________________________________________________




______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.