0
我有一個ADT,可以使用Advantage Data Architect進行修改。adsdb INSERT INTO
但我希望能夠使用adsdb修改表。我已經創建了使用;
cnxn = adsdb.connect(DataSource='c:/Python27/', ServerType='1')
cursor = cnxn.cursor()
cursor.execute('CREATE TABLE Persons (PersonID INTEGER, LastName CHAR(100), FirstName CHAR(100))'
我能夠插入數據到PersonsID字段使用;
cursor.execute('INSERT INTO Persons (PersonID) VALUES (01)')
但試圖將數據插入char類型的列使用;
cursor.execute('INSERT INTO Persons (LastName) VALUES ("Smith")')
我得到錯誤;
adsdb.OperationalError: Error 7200: AQE Error: State = S0000; NativeError = 2121; [iAnywhere Solutions][Advantage SQL Engine]Column not found: Smith -- Location of error in the SQL statement is: 40
我試過在VALUE字段中使用單引號和沒有引號,但我仍然出現錯誤。我已經提供了Google提供的錯誤代碼,但是我找不到解決方案。
明智的答案謝謝你。謝謝你的提示,Persons表只是爲了測試:) – apmacniven