| 제목 | 코드이그나이터에서 Oracle Sequence 사용시 에러 | ||
|---|---|---|---|
| 글쓴이 | citests | 작성시각 | 2015/06/15 17:46:49 | 
| 
                         | 
                |||
| 
                        코드이그나이터에서 Oracle 로 개발 중인데 자꾸 에러가 나서 질문합니다. 데이터 타입이 문자열일 때는 에러 없이 사용 할 수 있는데 자동증가 컬럼 (Sequence)를 사용 할려고 하면 데이터 타입(number) 오류가 남니다. 어떤 파일 어디를 고쳐야 수정 할 수 있나요 ?? 그리고 아래 입력 쿼리를 보면 " , ' 자동으로 붙어오는데 개발자가 수동으로 붙여 쓸수는 없나요? 아래 쿼리를 위 내용대로 고치면 에러 없이 입력 됩니다. 수고 하세요.. INSERT INTO "FORM_VALIDATOR" ("SEQ", "NAME", "TWITTER", "EMAIL", "INPUTPASSWORD", "UNDERWEAR", "TERMS") VALUES ('AUTO_SEQ_FORM.NEXTVAL', 'ddd', 'dddd', 'dfdfd@ddd.com', 'dddd', '1', '1')  | 
                |||
| 다음글 | Log 파일이 생성되지 않습니다. (7) | ||
| 이전글 | form_validation 에서 validation_... (3) | ||
| 
                             
                                변종원(웅파)
                                /
                                2015/06/15 17:53:34 /
                                추천
                                0
                             
                            
                                두번째나 세번째 파라미터로 false 주시면 ` 문제는 처리가 됩니다.
                             
                         | 
                    
| 
                             
                                citests
                                /
                                2015/06/15 17:59:07 /
                                추천
                                0
                             
                            
                                두번째나 세번째 파라미터로 false 어떤 function 을 말씀하시는건지 
                        저는 이런 식으로 사용하고 있습니다. 컨트롤러 $addDate = array ( 'SEQ' => AUTO_SEQ_FORM.NEXTVAL, 'NAME' => $this->input->post('inputName', TRUE), 'TWITTER' => $this->input->post('inputTwitter', TRUE), 'EMAIL' => $this->input->post('inputEmail', TRUE), 'INPUTPASSWORD' => $this->input->post('password', TRUE), 'UNDERWEAR' => $this->input->post('underwear', TRUE), 'TERMS' => $this->input->post('underwear', TRUE) ); $this->db_m->dateAdd('FORM_VALIDATOR', $addDate); 모델 function dateAdd($table, $insert_array) { $result = $this->db->insert($table, $insert_array); return $result; }  | 
                    
| 
                             
                                한대승(불의회상)
                                /
                                2015/06/15 18:22:06 /
                                추천
                                0
                             
                            
                                아래처럼 수정해 주세요. 
                        
$addDate = array (
                'NAME' => $this->input->post('inputName', TRUE),
                'TWITTER' => $this->input->post('inputTwitter', TRUE),
                'EMAIL' => $this->input->post('inputEmail', TRUE),
                'INPUTPASSWORD' => $this->input->post('password', TRUE),
                'UNDERWEAR' => $this->input->post('underwear', TRUE),
                'TERMS' => $this->input->post('underwear', TRUE)                
            );
        
     $this->db_m->dateAdd('FORM_VALIDATOR', $addDate);   
* 모델
function dateAdd($table, $insert_array) {
        $this->db->set('SEQ', 'AUTO_SEQ_FORM.NEXTVAL', FALSE);
 $result = $this->db->insert($table, $insert_array);
        return $result;
    }
                             |