Subject: | primary_key_info() not working with TeraData ODBC version >= 15.10 |
Hi,
$dbh->primary_key_info( undef, $schema, $tbl ) or
$dbh->func(undef, $schema, $tbl, "GetPrimaryKeys");
is not working for TeraData 15.10 and above.
Scripts:
Create table:
CREATE MULTISET TABLE pw_clean.Test_PRIMARY_KEY ,FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
FREESPACE = 10 PERCENT,
CHECKSUM = DEFAULT,
DEFAULT MERGEBLOCKRATIO
(
MAP_TID VARCHAR(50) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
CREATE_DTM TIMESTAMP(6) NOT NULL,
UPDATE_DTM TIMESTAMP(6) NOT NULL)
UNIQUE PRIMARY INDEX PK_Test_PRIMARY_KEY ( MAP_TID );
PER SCRIPT TO GET DATA:
my $db_conn_str = "dbi:ODBC:driver=\{Teradata\};
DBCName=$db_instance;
database=$db_schema;
uid=$db_user;
pwd=$db_pass";
my $dbh = DBI->connect($db_conn_str, $db_user, $db_pass, {
AutoCommit => 1,
PrintError => 0,
RaiseError => 0
}) ;
my $sth = $dbh->primary_key_info( undef, $schema, $tbl ) ;
unless ( $sth ) { die "Error: getting Statement handle for primary_key_info Schema:$schema Tbl:$tbl\n"; }
while ( my @row = $sth->fetchrow_array() ) {
print "PK ROW [ @row ] and row[3]:$row[3]\n";
last; # for testing
}
print "==========finish====\n";