[問題] sql問題?
想請問前輩們 是我sql沒導入 還是哪邊有問題啊?
import sqlite3
conn=sqlite3.connect('test.sqlite')
cursor=conn.cursor()
abc='CREATE TABLE IF NOT EXITS table01 \ <=若把\拿掉變成錯誤2
("num" INTEGER PRIMARY KEY NOT NULL,"tel" TEXT)'
ace='insert into table01 values(1,"03-1234567")'
cursor.execute(abc)
cursor.execute(ace)
conn.commit()
conn.close()
OperationalError: near "EXITS": syntax error -錯誤1
SyntaxError: EOL while scanning string literal -錯誤2
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.62.247.25 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1582529524.A.7EC.html
→
02/24 15:54,
5年前
, 1F
02/24 15:54, 1F
→
02/24 16:26,
5年前
, 2F
02/24 16:26, 2F
→
02/24 16:26,
5年前
, 3F
02/24 16:26, 3F
推
02/24 19:31,
5年前
, 4F
02/24 19:31, 4F
Python 近期熱門文章
PTT數位生活區 即時熱門文章