in reply to Unable to Connect using DBI & DBD-Teradata
I had to install RPC::PlClient to get DBD::Proxy to work, and when I first tried my new version it complained about maxmessage size being too small. I had to increase that a bunch in RPC::PlClient to get DBD::Proxy to work, but when it did I got right back to the problem I started with which is my DBI::connect statemnent doesn't return. No error messages or warnings.#!/usr/bin/perl # # DBCInfo Query Based on Cannonical Perl DBI connection to Mysql. ###################################################################### +######## use strict; use warnings; use DBI; use DBD::Proxy; use DBD::Teradata; my $host = "Host.Address"; # = "localhost", the server your are on. my $db = "User"; # your username (= login name = account name ) my $user = $db; # your Database name is the same as your acc +ount name. my $pwd = 'Password'; # Your account password # connect to the database. print(__PACKAGE__ . ':' . __LINE__ . ":Connecting...\n"); my $dbh = DBI->connect( "DBI:Proxy:hostname=Proxy.Server.Address;port= +8080;dsn=DBI:Teradata:$host", $user, $pwd) or die "Connecting : $DBI::errstr\n "; print(__PACKAGE__ . ':' . __LINE__ . ":Connected.\n"); my $sql = "SELECT * FROM DBC.DBCInfo"; # executing the SQL statement. my $sth = $dbh->prepare($sql) or die "preparing: ",$dbh->errstr; $sth->execute or die "executing: ", $dbh->errstr; print "content-type: text/html\n\n"; # one of the functions to retrieve data from the table results # check perldoc DBI for more methods. while (my $row = $sth->fetchrow_hashref) { foreach(sort(keys(%$row))) { print("$_:\[$row->{$_}\]\n"); } }
|
|---|