0

sqlite では、エスケープされていない一致しない引用符を含むデータをクエリすることは可能ですか?

たとえば、セパレータは に設定されてい|ます。

starships|spacecr"aft|snoo"py|rhythm

挿入を使用しても問題はありません。問題なく動作します。問題は、要素を .import で区切ることです。私の要点を説明するために、次の内容の test.dat というファイルを作成しました。

starships|spacecr"aft|snoo"py|rhythm

次に、以下を実行します。

sqlite> create table t (a,b,c,d);
sqlite> .separator '|'
sqlite> .import test.dat t
Error: test.dat line 1: expected 4 columns of data but found 3
4

1 に答える 1

1

はい、可能です:

sqlite> create table t (f1 string, f2 string, f3 string, f4 string);
sqlite> insert into t values ('starships', 'spacecr"aft', 'snoo"py', 'rhythm');
sqlite> select * from t;
starships|spacecr"aft|snoo"py|rhythm
sqlite> select * from t where f2 = 'spacecr"aft';
starships|spacecr"aft|snoo"py|rhythm
于 2012-07-25T07:47:23.723 に答える