Re: Python: Text file insert to MySQL

Discussion in 'Python' started by Gerhard Häring, Oct 7, 2009.

  1. On Wed, Oct 7, 2009 at 1:32 PM, Schedule <> wrote:
    > That was great ! Now I am able to insert the values from the file.
    >
    > Somehow I am not able to update a specific field with all the vaues in the
    > file. For eg:
    >     [...]
    >     c.execute("UPDATE a SET last = %s", row)


    The database does what you say, not what you mean ;-)

    SQL commands like SELECT, UPDATE, DELETE work on sets. If you don't
    qualify the set any further, you always operate on the whole set.

    To restrict the set, apply a WHERE clause. I. e.

    Perhaps you should try a SQL tutorial before jumping into SQL +
    Python. Here's one:

    http://sqlzoo.net/

    -- Gerhard
    Gerhard Häring, Oct 7, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JL
    Replies:
    0
    Views:
    1,142
  2. Replies:
    2
    Views:
    6,191
  3. Jeffrey H. Coffield
    Replies:
    1
    Views:
    1,852
  4. Roedy Green
    Replies:
    0
    Views:
    1,471
    Roedy Green
    Jul 23, 2009
  5. Gerhard Häring

    Re: Python: Text file insert to MySQL

    Gerhard Häring, Oct 6, 2009, in forum: Python
    Replies:
    0
    Views:
    485
    Gerhard Häring
    Oct 6, 2009
Loading...

Share This Page