#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    62
    Rep Power
    0

    Using Load data command


    Hi

    Can someone tell me how can I use the variable table with the load data command as shown below.

    Code:
    result = num
    s = "PowerData"
    table = (s + repr(result))
    print table
    #Query under testing
    sql = "LOAD DATA LOCAL INFILE '/var/www/backup/database_power.csv' INTO TABLE table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' IGNORE 1 LINES;"
    #Execute the SQL command
    cursor.execute(sql)
    # Commit your changes in the database
    conn.commit()
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    62
    Rep Power
    0
    I have solved this problem

IMN logo majestic logo threadwatch logo seochat tools logo