mikeprestim
Programmer
Hi
I have installed MS SQL server on my pc and created DB called test. I have also created my table to it. When i try and query the table i get an invalid object name error refering to my table. I know my table is spelt correctly and i can see the table in Enterprise manager. If i change the table name to one of the default tables then all is ok.
Below is my code it is just stock stuff. Does any one have any ideas
use DBI;
use DBD::ODBC;
my $dbh = DBI->connect( "DBI:ODBC:test", "", "" ) or
die( "Could not make connection to database: $DBI::errstr" );
my $sth = $dbh->prepare( 'SELECT * FROM dtImp' ) or
die( "Cannot prepare statement: ", $dbh->errstr(), "\n" );
my $rc = $sth->execute() or
die( "Cannot execute statement: ", $sth->errstr(), "\n" );
my @array;
while ( @array = $sth->fetchrow_array() ) {
write();
}
# Check to see if fetch terminated early
warn( $DBI::errstr ) if $DBI::err;
$sth->finish();
$dbh->disconnect();
format STDOUT =
@<<<<<<@<<<<<<<<<
$array[ 0 ], $array[ 1 ]
.
I have installed MS SQL server on my pc and created DB called test. I have also created my table to it. When i try and query the table i get an invalid object name error refering to my table. I know my table is spelt correctly and i can see the table in Enterprise manager. If i change the table name to one of the default tables then all is ok.
Below is my code it is just stock stuff. Does any one have any ideas
use DBI;
use DBD::ODBC;
my $dbh = DBI->connect( "DBI:ODBC:test", "", "" ) or
die( "Could not make connection to database: $DBI::errstr" );
my $sth = $dbh->prepare( 'SELECT * FROM dtImp' ) or
die( "Cannot prepare statement: ", $dbh->errstr(), "\n" );
my $rc = $sth->execute() or
die( "Cannot execute statement: ", $sth->errstr(), "\n" );
my @array;
while ( @array = $sth->fetchrow_array() ) {
write();
}
# Check to see if fetch terminated early
warn( $DBI::errstr ) if $DBI::err;
$sth->finish();
$dbh->disconnect();
format STDOUT =
@<<<<<<@<<<<<<<<<
$array[ 0 ], $array[ 1 ]
.