2012-11-12 2 views
1

도와주세요. 이 오류를 받고 있어요 : 나는 DB 테이블을 만들려고 해요 방법SQLiteException : 근처/TABLE_NAME/: 구문 오류

다음
Caused by: android.database.sqlite.SQLiteException: near "values": syntax error: CREATE TABLE values (_id INTEGER PRIMARY KEY AUTOINCREMENT, name text, caption text, lines integer , photo_url text, type text); 

은 다음과 같습니다

private static final String TABLE_VALUES_CREATE = 
    "CREATE TABLE " + DATABASE_TABLE_VALUES + 
      " (_id INTEGER PRIMARY KEY AUTOINCREMENT, " 
      + ValueTemplate.KEY_NAME + " text, " 
      + ValueTemplate.KEY_CAPTION + " text, " 
      + ValueTemplate.KEY_LINES + " integer , " 
      + ValueTemplate.KEY_PHOTOURL + " text, " 
      + ValueTemplate.KEY_TYPE + " text);"; 

    //ValueTemplate class: 
    // VALUE TEMPLATES 

     public static final String KEY_CAPTION = "caption"; 
     public static final String KEY_NAME = "name"; 
     public static final String KEY_TYPE = "type"; 
     public static final String KEY_LINES = "lines"; 
     public static final String KEY_PHOTOURL = "photo_url"; 

답변

4

을 내가 때문에 (값을) 생각 예약 된 이름은, 테이블의 이름을 변경 ..

+0

과 같은 것으로 바꿉니다. 그게 내 문제를 해결 했어. – user1766287

2

당신이 다음 [values]을 시도 동일한 테이블 이름을 유지를 주장하는 경우 그렇지 않으면 가장 좋은 이름은 tblValues

관련 문제