Background Image

FORUM

2010.12.10 22:55

esql 컴파일시 에러

조회 수 9396 추천 수 0 댓글 4
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

리눅스에서 큐브리드 사용하는데 초기 컴파일 환경잡고 테이블 insert하려는데 에러가 나네요.

숫자형은 별도의 문자열에 저장후 작업해야된다고 해서 다음과 같이 작업했습니다.

 

        EXEC SQL BEGIN DECLARE SECTION;
                VARCHAR  user_id[16];
                VARCHAR  user_name[40];
                DB_VALUE test_numeric_col;
        EXEC SQL END DECLARE SECTION;

 

        char    numeric_buf[40];

        uci_startup("testdbcon");

        EXEC SQL whenever sqlerror call sql_error;

        
        EXEC SQL CONNECT 'supream' identified by 'dba' with 'data1234';

        
        strcpy(user_id.array, "Hong");
        user_id.length = strlen(user_id.array);

        strcpy(user_name.array, "홍길동");
        user_name.length = strlen(user_name.array);


        strcpy(numeric_buf, "123456.4321");
        db_value_domain_init(&test_numeric_col, DB_TYPE_NUMERIC, 15, 4); 
        db_value_put(&test_numeric_col, DB_TYPE_C_VARCHAR, (void *)numeric_buf, strlen(numeric_buf));


        EXEC SQL insert into oms_user(user_id,user_name, test_numeric_col)
                 values(:user_id, :user_name, :test_numeric_col);

        EXEC SQL commit work;

        EXEC SQL disconnect;

 

이걸 실행하면 다음 에러메세지가 납니다.

TestCubridInput.ec: In function 'int main()':
TestCubridInput.ec:55: error: invalid conversion from 'int' to 'DB_TYPE_C'
TestCubridInput.ec:55: error:   initializing argument 5 of 'void uci_put_value(DB_INDICATOR*, DB_TYPE, int, int, DB_TYPE_C, void*, int)'

 

샘플에 있는거 그대로 같다 했는데 numeric형을 Insert하려니까 에러가 나네요...

참고로 numeric형을 제외한 string형만 Insert했을때는 제대로 돌아갔습니다.

그리고 숫자형(실수형이나 정수형)를 다루려면 문자열변환해서 하는 작업 말고는 바로 입력하는 방법은 있는지요?

  • ?
    janus 2010.12.11 00:15

    제가 테스트한 환경에서는 잘됩니다.

    혹시 샘플문서를 그대로 하셔도 똑같으신지와 제품버전을 알려 주셨으면 합니다.

    제품버전은 cubrid_rel 명령으로 확인이 가능합니다.

     

     

  • ?
    남재우 2010.12.11 00:49

    에러가 발생한곳이 다른 라인인 것 같습니다만... 확인좀 부탁드리겠습니다.

  • ?
    프리스 2010.12.11 01:24 Files첨부 (1)

    제품버전이 아래와 같이 나왔습니다..

    CUBRID 2008 R3.1 (8.3.1.0152) (Nov  4 2010 11:00:35)

     

    보니까

    EXEC SQL insert into oms_user(user_id, user_name, test_numeric_col) values(:user_id, :user_name, :test_numeric_col);

    -> EXEC SQL insert into oms_user(user_id, user_name) values(:user_id, :user_name);

    이렇게 하니까 에러가 우선 안나네요.

    그럼 함수쓰는게 문제가 아니라 insert하는데 type이 안맞아서 에러가 나는걸까요?

    Table에서 test_numeric_col는 nemeric(15,4)로 선언했습니다.

     

    혹시 몰라서 file 첨부했습니다.

  • ?
    janus 2010.12.11 03:10

    첨부파일을 가지고 수행해 봤는데 문제없이 잘됩니다....

    아래는 제가 만든 oms_user 테이블입니다.

     <Attributes>

         user_id              CHARACTER VARYING(16)
         user_name            CHARACTER VARYING(40)
         test_numeric_col     NUMERIC(15,4)

     

     


  1. CUBRID 사용자를 위한 DBeaver 도구 출시 안내

    Date2024.04.23 Byadmin Views122
    read more
  2. SQLGate for CUBRID 영구 무료 라이선스 제공

    Date2020.04.09 Byadmin Views4476
    read more
  3. [긴급] CMT 오류 문의 드립니다.

    Date2010.12.29 By스마트 Views6490
    Read More
  4. broker 로그에 대해 여쭤봅니다.

    Date2010.12.29 By유겸아빠 Views6834
    Read More
  5. CMT 관련 문의 드립니다.

    Date2010.12.29 By스마트 Views8
    Read More
  6. 데이터베이스 추가시 오류 메시지

    Date2010.12.24 By종이 Views6969
    Read More
  7. 큐브리드 호스팅 서비스를 준비중에 있는데요..

    Date2010.12.23 By큐브리드호스팅 Views8033
    Read More
  8. CUBRID 2008 R3.0, R3.1 beta 에서의 PHP 모듈사용에 대한 질문

    Date2010.12.23 Bypotter Views7159
    Read More
  9. [긴급] odbc utf8 입력이 안됩니다..

    Date2010.12.23 By스마트 Views12414
    Read More
  10. UTF8지원 관련..

    Date2010.12.21 By스마트 Views7750
    Read More
  11. db실행 오류

    Date2010.12.21 BySoMa Views7876
    Read More
  12. 큐브리드 매니져 멈춤현상 2

    Date2010.12.21 By하하보이 Views7574
    Read More
  13. 호스트 추가 질문입니다.

    Date2010.12.21 By몽유객 Views13809
    Read More
  14. ACXEL_Installer를 이용할려는데

    Date2010.12.20 BySoMa Views7716
    Read More
  15. Windows Server 2008 64Bit에서 Cubrid 2008 R2.2 사용 가능여부

    Date2010.12.16 By종이 Views8868
    Read More
  16. [문의] 라이선스 관련 문의드립니다.

    Date2010.12.15 By히카리 Views3
    Read More
  17. 큐브리드 메니저 멈춤현상...

    Date2010.12.14 By하하보이 Views7850
    Read More
  18. 큐브리드 매니저에서 접속하는거..

    Date2010.12.14 By천상한별 Views7612
    Read More
  19. esql 컴파일시 에러관련 재문의

    Date2010.12.14 By프리스 Views7746
    Read More
  20. cubridmanager 실행시 오류 입니다.

    Date2010.12.11 By하하보이 Views10970
    Read More
  21. php 모듈 설치중 configure 오류 입니다.

    Date2010.12.11 By하하보이 Views8897
    Read More
  22. esql 컴파일시 에러

    Date2010.12.10 By프리스 Views9396
    Read More
Board Pagination Prev 1 ... 154 155 156 157 158 159 160 161 162 163 ... 201 Next
/ 201

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales