Using Multiple Statements

The Perl driver allows multiple statements to be prepared with one call and then executed with one call.

The Sybase ASE Database Driver for Perl currently allows for 25 concurrent database connections to any database. Results of multiple statements prepared with one call are sent back to the client as a single stream of data. Each distinct set of results is treated as a normal single result set, this means that the fetch method returns "undef" at the end of each set. The CT-Lib API ct_fetch() returns "CS_END_RESULTS" that the driver converts to "undef" after the last data has been retrieved.

You can use the syb_more_results statement handle attribute to check for result sets in the pipeline.

Example:

do {
    while($a = $sth->fetch) {
      ..for example, display data..
    }
  } while($sth->{syb_more_results});

Sybase recommends that you use this if you expect multiple result sets.