이 컬럼에서 데이터를 가져 오는 동안 나는 문제가 발생
를 가져 오는 동안 :
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)) {
@selcuk : 서버 및 CT lib 버전을 확인하고 질문에 추가 할 수 있습니까? * ct_connect 후에 * ct_capability 호출을 시도 했습니까? –
hello martin 그것은 ct_capability를 대체하는 의미가 없습니다. 나는 또한 CS_GET에서 CS_SET으로 작업을 설정하려고 시도했지만 너무 효과가 없었다. 텍스트 영역을 읽는 중 문제가 발생하지 않습니다. 저급 db에 익숙하지 않지만 친구가 내게 말했다. BLOB 유형으로 영역 (텍스트 영역)을 읽는 것이 끝날 수 있습니까? 이 경우 ct_lib에서 BLOB 유형을 읽을 수 있습니까? 감사합니다. – selcuk
더하기 나는이 명령이 실패하지 않은 eventhough를 도울 수 있다고 생각하는 코드를 시도했습니다. CS_RETCODE retcode2; int textsize = 1000000; retcode2 = ct_options (연결, CS_SET, CS_OPT_TEXTSIZE, & textsize, CS_UNUSED, NULL); 내가 sybase15 라이브러리를 사용하여 – selcuk