Menu

MySQLDb Insert Syntax

Help
cmnorton
2010-03-03
2012-09-19
  • cmnorton

    cmnorton - 2010-03-03

    What is the syntax for a single row insert?

     
  • Andy Dustman

    Andy Dustman - 2010-03-03

    Same as for any other SQL database.

    http://dev.mysql.com/doc/refman/5.0/en/insert.html

     
  • cmnorton

    cmnorton - 2010-03-03

    What is the syntax for building an INSERT command using MySQLDB. All that's in
    the documentation is multi-row. I'm looking for examples of single row
    inserts.

     
  • Andy Dustman

    Andy Dustman - 2010-03-03

    Just use cursor.execute(your_insert_query, tuple_of parameters)

     
  • cmnorton

    cmnorton - 2010-03-03

    Thanks for confirming I'm using the correct syntax.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.