2010-02-09 3 views
2
나는 그런 오류 메시지를 받았습니다 255 자

베이스 오류 열이 더 많은 다음 255 자

이 컬럼에서 데이터를 가져 오는 동안 나는 문제가 발생

를 가져 오는 동안 :

Open Client Message:
Message number: LAYER = (1) ORIGIN = (4) SEVERITY = (1) NUMBER = (132)
Message String: ct_fetch(): user api layer: internal common library error: The bind of result set item 3 resulted in truncation.

그것은 단지를 가져옵니다 처음 255 행 및 나머지는 자릅니다.

나는 당신이 어떤 제안을

for (i = 0; i < num_cols; i++) { 
     /* 
     ** Get the column description. ct_describe() fills the 
     ** datafmt parameter with a description of the column. 
     */ 
     retcode = ct_describe(cmd, (i + 1), &datafmt[i]); 
     if (retcode != CS_SUCCEED) { 
      ex_error("ex_fetch_data: ct_describe() failed"); 
      break; 
     } 

     /* 
     ** update the datafmt structure to indicate that we want the 
     ** results in a null terminated character string. 
     ** 
     ** First, update datafmt.maxlength to contain the maximum 
     ** possible length of the column. To do this, call 
     ** ex_display_len() to determine the number of bytes needed 
     ** for the character string representation, given the 
     ** datatype described above. Add one for the null 
     ** termination character. 
     */ 
     datafmt[i].maxlength = ex_display_dlen(&datafmt[i]) + 1; 

     /* 
     ** Set datatype and format to tell bind we want things 
     ** converted to null terminated strings 
     */ 
     datafmt[i].datatype = CS_LONGCHAR_TYPE; 
     datafmt[i].format = CS_FMT_NULLTERM; 

     /* 
     ** Allocate memory for the column string 
     */ 
     coldata[i].value = (CS_CHAR *) malloc(datafmt[i].maxlength); 
     if (coldata[i].value == NULL) { 
      ex_error("ex_fetch_data: malloc() failed"); 
      retcode = CS_MEM_ERROR; 
      break; 
     } 

     /* 
     ** Now bind. 
     */ 
     retcode = ct_bind(cmd, (i + 1), &datafmt[i], coldata[i].value, 
       &coldata[i].valuelen, (CS_SMALLINT *) &coldata[i].indicator); 
     if (retcode != CS_SUCCEED) { 
      ex_error("ex_fetch_data: ct_bind() failed"); 
      break; 
     } 
    } 


............. 
............. 
............. 

    /* 
    ** Fetch the rows. Loop while ct_fetch() returns CS_SUCCEED or 
    ** CS_ROW_FAIL 
    */ 
    while (((retcode = ct_fetch(cmd, CS_UNUSED, CS_UNUSED, CS_UNUSED, 
      &rows_read)) == CS_SUCCEED) || (retcode == CS_ROW_FAIL)) { 
+0

@selcuk : 서버 및 CT lib 버전을 확인하고 질문에 추가 할 수 있습니까? * ct_connect 후에 * ct_capability 호출을 시도 했습니까? –

+0

hello martin 그것은 ct_capability를 대체하는 의미가 없습니다. 나는 또한 CS_GET에서 CS_SET으로 작업을 설정하려고 시도했지만 너무 효과가 없었다. 텍스트 영역을 읽는 중 문제가 발생하지 않습니다. 저급 db에 익숙하지 않지만 친구가 내게 말했다. BLOB 유형으로 영역 (텍스트 영역)을 읽는 것이 끝날 수 있습니까? 이 경우 ct_lib에서 BLOB 유형을 읽을 수 있습니까? 감사합니다. – selcuk

+0

더하기 나는이 명령이 실패하지 않은 eventhough를 도울 수 있다고 생각하는 코드를 시도했습니다. CS_RETCODE retcode2; int textsize = 1000000; retcode2 = ct_options (연결, CS_SET, CS_OPT_TEXTSIZE, & textsize, CS_UNUSED, NULL); 내가 sybase15 라이브러리를 사용하여 – selcuk

답변

0

심지어 우리가 직면 한 문제가 않습니다 ct_connect 전에 선 아래 암시하는 시도했지만 여기

CS_BOOL boolv = CS_TRUE; 
CS_RETCODE retcode2 = ct_capability (*connection, CS_GET, CS_CAP_REQUEST, CS_WIDETABLES, &boolv); 

코드의 일부입니다 작동하지 않았다 우리가 Uniface와 함께 Sybase를 사용할 때, uniface sybase 드라이버는 데이터를 자르고 다른 테이블에 저장하는 옵션을 가지고 있지만 페칭하는 동안 모든 테이블에서 데이터를 가져와야합니다.

0

원시 jconn * .jar 드라이버를 사용하는 경우 JDBC 드라이버에서 "? CHARSET = iso_1"매개 변수를 설정하여 기본 문자 집합이 로마 8 인 Sybase 서버에 연결해야합니다. 그렇지 않으면이 255 자의 잘림이 표시됩니다 발행물.

발생하는 문제 일 수 있습니까?