这些是我们必须使用SQL来编码的要求,我们必须在表格中进行检查。
我找不到有用的答案 -
d['ABC']
Date Particulars Inwards Code
2 2017-07-22 ABC 100 1
4 2018-03-13 ABC 2000 1
错误消息:
CREATE TABLE data
(
data_Name VARCHAR(10) UNIQUE,
data_totals INT,
CONSTRAINT [data_totals_test] CHECK (data_totals between 1 and 5 )
);
如果我这样做
syntax error in constraint clause
或者
CREATE TABLE data
(
data_Name VARCHAR(10) UNIQUE,
data_totals INT,
CHECK (data_totals between 1 and 5 )
);
我在两种情况下都收到错误消息 -
CREATE TABLE data
(
data_Name VARCHAR(10) UNIQUE,
data_totals INT,
CHECK (data_totals > 1 and data_totals < 5 )
);
如果我在INT之后取出,那么我收到错误消息:
syntax error in field definition
也尝试了这个:
以这种方式创建表(成功)
syntax error in Create Table Statement.
尝试使用alter:
CREATE TABLE data
(
data_Name VARCHAR(10) UNIQUE,
data_totals INT
);
得到了同样的错误:
alter table data ADD CHECK (data_totals > 1 );
请指教。
答案 0 :(得分:1)
设置为ANSI 92 SQL
if(Application.platform != RuntimePlatform.Android)
_filepath = Application.dataPath + "/" + _DBName;
else
{
_filepath = Application.persistentDataPath + "/" + _DBName;
if (!File.Exists(_filepath))
{
//Debug.Log("Check in");
WWW loadDB = new WWW("jar:file://" + Application.dataPath +
"!/assets/" + _DBName);
while (!loadDB.isDone) { }
File.WriteAllBytes(_filepath, loadDB.bytes);
}
}
_StringConnection = "URI=file:" + _filepath;
替代地
CREATE TABLE data
(
data_Name VARCHAR(10) UNIQUE,
data_totals INT CHECK (data_totals > 1 and data_totals < 5)
);