Ct_results () and ct_cmd_drop () error with Sybase :: CTlib

I am using Sybase :: CTlib to query a Sybase server. However, when I do the following:

while( $dbr->ct_results($restype) == CS_SUCCEED ) {
    if( $restype == CS_CMD_FAIL ) {
    warn "Update Check Failed...";
    next;
    }
    next unless $dbr->ct_fetchable($restype);
    $ts = $dbr->ct_fetch;
}

My query returns exactly one value. That is why I am reading a single variable.

I get errors:

Open client
message: Message number: LAYER = (1) ORIGIN = (1) NORTHERN = (1) NUMBER = (163)
Message line: ct_results (): user api layer: external error: this procedure cannot be called until until all the results are fully processed.

:
: LAYER = (1) ORIGIN = (1) = (1) = (159)
: ct_cmd_drop(): user api layer: : , .

?

+3
2

ct_fetch ( ), SQL . false.

brian d foy, , (1 while (my @data = $dbh->ct_fetch);, . , , , .

SyBooks ct_fetch:

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.sdk_12.5.1.ctref/html/ctref/X65123.htm

, , ct_fetch, ct_fetch , .

- , , ct_fetch CS_SUCCEED CS_ROW_FAIL. switch-type ct_fetchs, , .

, ct_fetch CS_END_DATA.

: ct_fetch , . ct_fetch, CS_SUCCEED CS_ROW_FAIL.

, "CTLib", CTLib, "result set completed", true , ct_fetch , ( , , brian d foy); CTLib- 163, false.

, 100%, CTLib,

0

, ct_fetch? Sybase, , , , , , , , .

while( $dbr->ct_results($restype) == CS_SUCCEED ) {
    if( $restype == CS_CMD_FAIL ) {
        warn "Update Check Failed...";
        next;
        }
    next unless $dbr->ct_fetchable($restype);
    $ts = $dbr->ct_fetch;
    1 while(my @data = $dbh->ct_fetch); # discard the rest
}
0

Source: https://habr.com/ru/post/1771251/


All Articles