Bug #2508: #table handling issue
| From: | nicholas dot steel at greenwichnatwest dot com | Date: | Wed, 13 Oct 1999 16:48:31 +0000 |
| Subject: | Bug #2508: #table handling issue | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-11722@lists.php.net to get a copy of this message | ||
From: nicholas.steel@greenwichnatwest.com
Operating system: Solaris 2.6
PHP version: 3.0.12
PHP Bug Type: Sybase (dblib) related
Bug description: #table handling issue
if you call a piece of T-SQL (sybase sql) that uses a temporary table - although it only returns one
result set - php3 seems to get lost and returns an error of:
1 is not a Sybase result index ...
a sample piece of sql would be:
################# START SAMPLE ####################
create table #mytable (name varchar(30))
insert into #mytable
select name from sysobjects
select name from #mytable
################# END SAMPLE ####################
a sample piece of php3 would be:
################# START SAMPLE ####################
$dbh = sybase_connect ($server , $user, $password);
$row_handle = sybase_query ($sql , $dbh);
while ($A_row = sybase_fetch_row($row_handle))
{
print $A_row[0];
}
################# END SAMPLE ####################
although this is a trivial example - you see more sophisticated versions of this quite a lot in
Sybase code.
NB: Perl does handle this correctly as does isql so its not an inherent failure in db-library.
NNB it does this in ct-library as well.