2012-07-25 7 views
0

sqlite에서 이스케이프 처리되지 않은 일치하지 않는 인용 부호가 포함 된 데이터를 쿼리 할 수 ​​있습니까?일치하지 않는 따옴표가 포함 된 SQL 쿼리

예를 들어, 구분 기호는 |으로 설정됩니다.

starships|spacecr"aft|snoo"py|rhythm 

삽입 사용은 문제가되지 않습니다. 문제는 .import로 요소를 구분하는 것입니다.

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 

답변

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 

starships|spacecr"aft|snoo"py|rhythm 

그런 다음 다음을 실행합니다 : 나의 점을 설명하기 위해, 나는 내용으로 TEST.DAT라는 파일을 생성

관련 문제