这个SQLite查询有什么问题?

时间:2022-06-01 19:50:37

I'm creating an AIR application which connects to a SQLite database. The database balks at this insert statement, and I simply cannot figure out why. There is no error, it simply does not move on.

我正在创建一个连接到SQLite数据库的AIR应用程序。这个插入语句中的数据库很糟糕,我根本无法找出原因。没有错误,它根本不会继续前进。

INSERT INTO Attendee (AttendeeId,ShowCode,LastName,FirstName,Company,Address,Address2,City,State,ZipCode,Country,Phone,Fax,Email,BuyNum,PrimaryBusiness,Business,Employees,Job,Value,Volume,SpouseBusiness,DateAdded,ConstructionWorkType,UserPurchaser,DecisionMaker,SafetyProducts,NearFuturePurchase,RepContact,Winner) VALUES('39610','111111','SMITH','JIM','COMPANY','1000 ROAD STREET','','PITTSBURGH','PA','15219','','5555555555','5555555555','PERSON@EXAMPLE.NET','','','0000000000000000000','','','','','0?','Fri Jan 30 14:20:08 GMT-0500 2009','other','neither','no','gas_detection','no','no','winner')

I know that the app can connect to the database, because it creates the table just fine. Here's the schema for the table for your reference:

我知道应用程序可以连接到数据库,因为它可以很好地创建表。以下是该表的架构供您参考:

CREATE TABLE Attendee (AttendeeId TEXT PRIMARY KEY,ShowCode TEXT,LastName TEXT,FirstName TEXT,Company TEXT,Address TEXT,Address2 TEXT,City TEXT,State TEXT,ZipCode TEXT,Country TEXT,Phone TEXT,Fax TEXT,Email TEXT,BuyNum TEXT,PrimaryBusiness TEXT,Business TEXT,Employees TEXT,Job TEXT,Value TEXT,Volume TEXT,SpouseBusiness TEXT,DateAdded TEXT,ConstructionWorkType TEXT,UserPurchaser TEXT,DecisionMaker TEXT,SafetyProducts TEXT,NearFuturePurchase TEXT,RepContact TEXT, Winner TEXT)

There is a good chance that there is an error in the INSERT statement, because if I try to execute it on a separate Adobe Air SQLite admin program, it throws an ambiguous error (#3115).

INSERT语句中存在错误的可能性很大,因为如果我尝试在单独的Adobe Air SQLite管理程序上执行它,则会引发模糊错误(#3115)。

Thanks for any insight you might have.

感谢您的任何见解。

EDIT:

For those wondering, if I make a simple table, thus:

对于那些想知道的人,如果我做一个简单的表,那么:

CREATE TABLE Attendee (AttendeeId TEXT)

And try to insert, thus:

并尝试插入,因此:

INSERT INTO Attendee (AttendeeId) VALUES('09283A')

I still get error #3115.

我仍然得到错误#3115。

3 个解决方案

#1


insert into Attendee ("AttendeeId", "ShowCode", "LastName", "FirstName", "Company", "Address", "Address2", "City", "State", "ZipCode", "Country", "Phone", "Fax", "Email", "BuyNum", "PrimaryBusiness", "Business", "Employees", "Job", "Value", "Volume", "SpouseBusiness", "DateAdded", "ConstructionWorkType", "UserPurchaser", "DecisionMaker", "SafetyProducts", "NearFuturePurchase", "RepContact", "Winner") values ('39610', '111111', 'SMITH', 'JIM', 'COMPANY', '1000 ROAD STREET', '', 'PITTSBURGH', 'PA', '15219', '', '5555555555', '5555555555', 'PERSON@EXAMPLE.NET', '', '', '0000000000000000000', '', '', '', '', '0?', 'Fri Jan 30 14:20:08 GMT-0500 2009', 'other', 'neither', 'no', 'gas_detection', 'no', 'no', 'winner');

Try this one, it was computer generated.

试试这个,这是计算机生成的。

#2


Have you tried running smaller statements? Like, a really simple INSERT on a really simple table?

你试过运行较小的语句吗?就像在一个非常简单的表上一个非常简单的INSERT?

Have you tried quoting the column names? Maybe one of them is a reserved word.

你试过引用列名吗?也许其中一个是保留字。

#3


Apparently you need to use double quotes rather than single quotes.

显然你需要使用双引号而不是单引号。

#1


insert into Attendee ("AttendeeId", "ShowCode", "LastName", "FirstName", "Company", "Address", "Address2", "City", "State", "ZipCode", "Country", "Phone", "Fax", "Email", "BuyNum", "PrimaryBusiness", "Business", "Employees", "Job", "Value", "Volume", "SpouseBusiness", "DateAdded", "ConstructionWorkType", "UserPurchaser", "DecisionMaker", "SafetyProducts", "NearFuturePurchase", "RepContact", "Winner") values ('39610', '111111', 'SMITH', 'JIM', 'COMPANY', '1000 ROAD STREET', '', 'PITTSBURGH', 'PA', '15219', '', '5555555555', '5555555555', 'PERSON@EXAMPLE.NET', '', '', '0000000000000000000', '', '', '', '', '0?', 'Fri Jan 30 14:20:08 GMT-0500 2009', 'other', 'neither', 'no', 'gas_detection', 'no', 'no', 'winner');

Try this one, it was computer generated.

试试这个,这是计算机生成的。

#2


Have you tried running smaller statements? Like, a really simple INSERT on a really simple table?

你试过运行较小的语句吗?就像在一个非常简单的表上一个非常简单的INSERT?

Have you tried quoting the column names? Maybe one of them is a reserved word.

你试过引用列名吗?也许其中一个是保留字。

#3


Apparently you need to use double quotes rather than single quotes.

显然你需要使用双引号而不是单引号。