Rechercher une fonction PHP

sybase_unbuffered_query

(PHP 4 >= 4.3.0, PHP 5)

sybase_unbuffered_querySend a Sybase query and do not block

Warning

This function was REMOVED in PHP 7.0.0.

Description

sybase_unbuffered_query ( string $query , resource $link_identifier [, bool $store_result ] ) : resource

sybase_unbuffered_query() sends a query to the currently active database on the server that's associated with the specified link identifier. If the link identifier isn't specified, the last opened link is assumed. If no link is open, the function tries to establish a link as if sybase_connect() was called, and use it.

Unlike sybase_query(), sybase_unbuffered_query() reads only the first row of the result set. sybase_fetch_array() and similar function read more rows as needed. sybase_data_seek() reads up to the target row. The behavior may produce better performance for large result sets.

sybase_num_rows() will only return the correct number of rows if all result sets have been read. To Sybase, the number of rows is not known and is therefore computed by the client implementation.

Note:

If you don't read all of the resultsets prior to executing the next query, PHP will raise a warning and cancel all of the pending results. To get rid of this, use sybase_free_result() which will cancel pending results of an unbuffered query.

PHP: sybase_unbuffered_query - Manual Home of Manuel PHP  Contents Haut

Parameters

query

link_identifier

store_result

The optional store_result can be FALSE to indicate the resultsets shouldn't be fetched into memory, thus minimizing memory usage which is particularly interesting with very large resultsets.

PHP: sybase_unbuffered_query - Manual Home of Manuel PHP  Contents Haut

Return Values

Returns a positive Sybase result identifier on success, or FALSE on error.

PHP: sybase_unbuffered_query - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 sybase_unbuffered_query() example

<?php

$dbh 
sybase_connect('SYBASE''''');
$q sybase_unbuffered_query('select firstname, lastname from huge_table'$dbhfalse);
sybase_data_seek($q10000);
$i 0;

while (
$row sybase_fetch_row($q)) {
    echo 
$row[0], ' '$row[1], '<br />';
    if (
$i++ > 40000) {
        break;
    }
}

sybase_free_result($q);
sybase_close($dbh);

?>

PHP: sybase_unbuffered_query - Manual Home of Manuel PHP  Contents Haut

Notes

Note: This function is only available when using the CT library interface to Sybase, and not with the DB library.

Find a PHP function

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-sybase-unbuffered-query.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : http://php.net

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut