PythonとMysqldbライブラリを使用して、MongoDBからデータを取得し、MySQLデータベースに挿入します。
+-------------------+------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+------------+------+-----+---------+----------------+
| id | int(16) | NO | PRI | NULL | auto_increment |
| subject | tinytext | NO | | NULL | |
| created_at | datetime | NO | | NULL | |
+-------------------+------------+------+-----+---------+----------------+
created_at = "2012/06/08 11:47:40 -0700"
sql1 = ("INSERT INTO `items` (`description`, `created_at`) VALUES (%s, %s)", (description, created_at)
try:
cursor.execute(*sql1)
except MySQLdb.Error, e:
print "Error %s: %s" % (e.args[0], e.args[1])
データベースへの最初の挿入で警告が表示されますが、それ以降の挿入ではその警告は表示されません。
conf / db_tools-import.py:53:警告:行1の列'created_at'の範囲外の値cursor.execute(* sql1)
どうすればこれを解決できますか?ありがとう。