Oops... corrected to visibly use the same dbh but the problem is the same...
(They were the same dbh, but it was not obvious from the code sample before)
##################################################
my($sth_1, $sth_2, $sth_3);
$sth_1 = $dbh->prepare("select db_name()"); #### Changed from $sybh to
$dbh
$sth_1->execute();
while (my($d) = $sth_1->fetchrow_array()) {
print "***** $d *****\n";
}
##################################################
my $tabsth = $dbh->table_info();
my $colsth;
my $sql;
my $table;
###############################################################
$sth_1 = $dbh->prepare("select db_name()");
$sth_1->execute();
while (my($d) = $sth_1->fetchrow_array()) {
print "***** $d *****\n";
}
$sth_1->finish();
> -----Original Message-----
> From: Hall, Roger
> Sent: Tuesday, November 20, 2001 10:23 AM
> To: [EMAIL PROTECTED]
> Subject: table_info bug with Sybase - switches database ?
>
>
> Hi,
>
> I am using DBI-1.14.tar.gz and DBD-Sybase-0.91.tar.gz and am getting
> some behavior that I do not understand... I guess its either
> me or a bug.
>
> When I use table_info, I seem to be switching to the default
> database of the
> login id that I use. An example of some code I was testing
> stuff with is
> shown
> below. The two prints show me a different database.
>
> Roger.
>
>
> ##################################################
> my($sth_1, $sth_2, $sth_3);
> $sth_1 = $sybh->prepare("select db_name()");
> $sth_1->execute();
> while (my($d) = $sth_1->fetchrow_array()) {
> print "***** $d *****\n";
> }
> ##################################################
>
> my $tabsth = $dbh->table_info();
> my $colsth;
> my $sql;
> my $table;
>
> ###############################################################
> $sth_1 = $dbh->prepare("select db_name()");
> $sth_1->execute();
> while (my($d) = $sth_1->fetchrow_array()) {
> print "***** $d *****\n";
> }
>