GoLang mssql_fetch_batch

request it (305)
GoLang replacement for PHP's mssql_fetch_batch [edit | history]



Do you know a GoLang replacement for PHP's mssql_fetch_batch? Write it!

PHP mssql_fetch_batch

PHP original manual for mssql_fetch_batch [ show | php.net ]

mssql_fetch_batch

(PHP 4 >= 4.0.4, PHP 5, PECL odbtp >= 1.1.1)

mssql_fetch_batchReturns the next batch of records

Warning

This function was REMOVED in PHP 7.0.0.

Description

int mssql_fetch_batch ( resource $result )

Returns the next batch of records.

Parameters

result

The result resource that is being evaluated. This result comes from a call to mssql_query().

Return Values

Returns the number of rows in the returned batch.

Examples

Example #1 mssql_fetch_batch() example

<?php
// Connect to MSSQL and select the database
$link mssql_connect('MANGO\SQLEXPRESS''sa''phpfi');
mssql_select_db('php'$link);

// Send a query
$result mssql_query('SELECT * FROM [php].[dbo].[people]'$link100);
$records 10;

while (
$records >= 0) {
    while (
$row mssql_fetch_assoc($result)) {
        
// Do stuff ...
    
}

    --
$records;
}

if (
$batchsize mssql_fetch_batch($result)) {
    
// $batchsize is the number of records left 
    // in the result, but not shown above
}
?>