我寫了這個程序:錯誤SQL請求
con=kinterbasdb.create_database("create database 'D:/ThirdTask/test.db' user 'sysdba' password 'masterkey'")
conn=kinterbasdb.connect(host='localhost',database='D:/ThirdTask/test.db', user='sysdba', password='masterkey')
cur=con.cursor()
s="""
create table CLIENTS
(
ID FMTBCD PRIMARY KEY,
COMPANY CHAR(50),
LAST NAME CHAR(50),
FIRST NAME CHAR(50),
E-MAIL ADDRESS CHAR(50),
JOB TITLE CHAR(50),
BUSINESS PHONE CHAR(25),
HOME PHONE CHAR(25),
MOBILE PHONE CHAR(25),
FAX NUMBER CHAR(25),
ADDRESS MEMO,
CITY CHAR(50),
STATE/PROVINCE CHAR(50),
ZIP/POSTAL CODE CHAR(15),
COUNTRY/REGION CHAR(50),
WEB-SITE CHAR(25),
NOTES MEMO,
INCLUDING BLOB
)"""
print s
cur.execute(s)
con.close()
conn.close()
編譯器給出了以下錯誤:
create table CLIENTS
(
ID FMTBCD PRIMARY KEY,
COMPANY CHAR(50),
LAST NAME CHAR(50),
FIRST NAME CHAR(50),
E-MAIL ADDRESS CHAR(50),
JOB TITLE CHAR(50),
BUSINESS PHONE CHAR(25),
HOME PHONE CHAR(25),
MOBILE PHONE CHAR(25),
FAX NUMBER CHAR(25),
ADDRESS MEMO,
CITY CHAR(50),
STATE/PROVINCE CHAR(50),
ZIP/POSTAL CODE CHAR(15),
COUNTRY/REGION CHAR(50),
WEB-SITE CHAR(25),
NOTES MEMO,
INCLUDING BLOB
)
Traceback (most recent call last):
File "D:\ThirdTask\connect.py", line 119, in <module>
cur.execute(s)
ProgrammingError: (-104, 'isc_dsql_prepare: \n Dynamic SQL Error\n SQL error code = -104\n Token unknown - line 6, column 16\n CHAR')
可能是什麼錯誤的原因是什麼?
閱讀問題時'bla'錯誤豐富。 (提示:如果你想讓任何人閱讀這個令人震驚的介紹,請更改這個問題) – xtofl
正如你所提出的那樣,很少有人會打擾你回答你的問題。請訪問http://www.whathaveyoutried.com並按照這些說明進行操作。 – HerrKaputt