Subject: | DBD Teradata connection |
C:\Temp\MBelobaba_Dev\MB>perl -d testdbi.pl
Loading DB routines from perl5db.pl version 1.28
Editor support available.
Enter h or `h h' for help, or `perldoc perldebug' for more help.
main::(testdbi.pl:8): my $RS8;
DB<1> n
main::(testdbi.pl:9): my $DHandle;
DB<1> n
main::(testdbi.pl:11): my $dsnname = "192.168.6.111";
DB<1> n
main::(testdbi.pl:12): my $username = "D_MDSDEV";
DB<1> n
main::(testdbi.pl:13): my $password = "ttt";
DB<1> n
main::(testdbi.pl:16): print "before connect\n";
DB<1> n
before connect
main::(testdbi.pl:17): eval {
DB<1> n
main::(testdbi.pl:18): $DHandle = DBI->connect
("DBI:Teradata:$dsnname",$usernam
e,$password, {PrintError =>0, RaiseError => 1});
DB<1> n
Debugged program terminated. Use q to quit or R to restart,
use o inhibit_exit to avoid stopping after program termination,
h q, h R or h o to get additional info.
DB<1> h o
o [opt] ... Set boolean option to true
o [opt?] Query options
o [opt=val] [opt="val"] ...
Set options. Use quotes in spaces in value.
recallCommand, ShellBang chars used to recall command or spawn
shell;
pager program for output of "|cmd";
tkRunning run Tk while prompting (with ReadLine);
signalLevel warnLevel dieLevel level of verbosity;
inhibit_exit Allows stepping off the end of the script.
ImmediateStop Debugger should stop as early as possible.
RemotePort Remote hostname:port for remote debugging
The following options affect what happens with V, X, and x commands:
arrayDepth, hashDepth print only first N elements ('' for all);
compactDump, veryCompact change style of array and hash dump;
globPrint whether to print contents of globs;
DumpDBFiles dump arrays holding debugged files;
DumpPackages dump symbol tables of packages;
DumpReused dump contents of "reused" addresses;
quote, HighBit, undefPrint change style of string dump;
bareStringify Do not print the overload-stringified value;
Other options include:
PrintRet affects printing of return value after r command,
frame affects printing messages on subroutine entry/exit.
AutoTrace affects printing messages on possible breaking points.
maxTraceLen gives max length of evals/args listed in stack
trace.
ornaments affects screen appearance of the command line.
CreateTTY bits control attempts to create a new TTY on events:
1: on fork() 2: debugger is started inside debugger
4: on startup
During startup options are initialized from $ENV{PERLDB_OPTS}.
You can put additional initialization options TTY, noTTY,
ReadLine, NonStop, and RemotePort there (or use
`R' after you set them).
DB<2> q
C:\Temp\MBelobaba_Dev\MB>ppm
PPM - Programmer's Package Manager version 3.4.
Copyright (c) 2001 ActiveState Software Inc. All Rights Reserved.
Entering interactive shell. Using Term::ReadLine::Perl as readline
library.
Type 'help' to get started.
C:\Temp\MBelobaba_Dev\MB>perl -v
This is perl, v5.8.8 built for MSWin32-x86-multi-thread
(with 21 registered patches, see perl -V for more detail)
Copyright 1987-2006, Larry Wall
Binary build 816 [255195] provided by ActiveState
http://www.ActiveState.com
Built Mar 1 2006 18:00:52
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5 source
kit.
Complete documentation for Perl, including FAQ lists, should be found
on
this system using "man perl" or "perldoc perl". If you have access to
the
Internet, point your browser at http://www.perl.org/, the Perl Home
Page.
C:\Temp\MBelobaba_Dev\MB>ppm
PPM - Programmer's Package Manager version 3.4.
Copyright (c) 2001 ActiveState Software Inc. All Rights Reserved.
Entering interactive shell. Using Term::ReadLine::Perl as readline
library.
Type 'help' to get started.
Show quoted text
ppm> query dbi
Querying target 1 (ActivePerl 5.6.1.633)
1. DBI [1.42] Database independent interface for Perl
Show quoted textppm> query crypt-blowfish
Querying target 1 (ActivePerl 5.6.1.633)
1. Crypt-Blowfish [2.10] Perl Blowfish encryption module
Show quoted textppm>
##### Please HELP ####
I had lot experience with DBI and DBD Teradata with older versions of
active perl
Subject: | testdbi.pl |
#!/usr/bin/perl
#===============================================================================
# Author: Milan Belobaba 29 Mar 2006
#================================================================================
use Time::Local;
use DBI;
my $RS8;
my $DHandle;
my $dsnname = "192.168.6.219";
my $username = "D_MDSDEV";
my $password = "mds";
# Open the Database
print "before connect\n";
eval {
$DHandle = DBI->connect("DBI:Teradata:$dsnname",$username,$password, {PrintError =>0, RaiseError => 1});
};
# Error-check. If $@ is set we do not have a connection.
print "ret: $@\n";
if($@) {
print "DB Open Error $@\n";
exit;
}
else {
# We do have a connection !!!
print "Connection $@\n";
eval {
$RS8 = $DHandle->prepare("Select count(*) Cnt from Dev_Mds.TheDay_V;");
$RS8->execute;
$RS8->finish;
};
print "prep: $@\n";
if (!$@) {
@Row = '';
# while (@ARef = $RS8->fetchrow_array()) {
# $Row = $ARef[0];
# }
$Cnt = $Row + 0;
print "Counter: $Cnt\n";
}
}