안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요 다름이 아니라 내장 db인 sqlite를 사용때문에 문의를 드립니다
db에 데이터타입이 총 4가지가 있는데요 time 과 date입니다 이 두가지를 primary key로 묶어서 중복되지 않게 하려고합니다
가령 2011년 1월 12일 오전 10시 가 2개가 되지 않게말이죠
테이블 생성시 코드를
static final String CREATE_TABLE="create table memolist (" +
"_id integer primary key autoincrement, "+
//"dist text not null,"+
"time text not null,"+
"obj text not null,"+
"date text not null,"+
"sub text not null);";
이렇게 했다가
static final String CREATE_TABLE="create table memolist (" +
"_id integer not null "+
//"dist text not null,"+
"time text not null,"+
"obj text not null,"+
"date text not null,"+
"sub text not null" +
"primary key(_id,date,time));";
이런식으로 바꿔봤는데에러가 나서요...
도움부탁드립니다
db에 데이터타입이 총 4가지가 있는데요 time 과 date입니다 이 두가지를 primary key로 묶어서 중복되지 않게 하려고합니다
가령 2011년 1월 12일 오전 10시 가 2개가 되지 않게말이죠
테이블 생성시 코드를
static final String CREATE_TABLE="create table memolist (" +
"_id integer primary key autoincrement, "+
//"dist text not null,"+
"time text not null,"+
"obj text not null,"+
"date text not null,"+
"sub text not null);";
이렇게 했다가
static final String CREATE_TABLE="create table memolist (" +
"_id integer not null "+
//"dist text not null,"+
"time text not null,"+
"obj text not null,"+
"date text not null,"+
"sub text not null" +
"primary key(_id,date,time));";
이런식으로 바꿔봤는데에러가 나서요...
도움부탁드립니다