Options

Perl->DBD::ODBC warning

 

Hello,

 

I am new to Vertica and have some question when using "select" query against one of nodes by Perl->DBI & Perl->DBD::ODBC.

 

With DBI 1.633 and DBD::ODBC 1.52, when connecting to DB with some attributes as an argument, then I got the warning message.

 

        my $attr = {
                RaiseError => 1, # Make database errors fatal to script
                AutoCommit => 0, # Prevent statements from committing transactions;
        };

 

-----------------------------------------------------------

 WARN  2554910464 Statement::EndTransaction: [Vertica][ODBC] (10210) Attribute identifier invalid or not supported: 24
DBD::ODBC::db disconnect warning: Disconnect with transaction in progress - rolling back at VerticaDBI.pm line 69.

-----------------------------------------------------------

 

Without the argument (or set this as undef), then there is no warning at all.

Can we apply the attribute to Vertica?

With/Without the argument, the query results were the same.

 

#I know the both versions I use are out of pre-requisite.

 

 

The constructor I made is:

 

sub new {

        my $cls = shift;

        #$ENV{VERTICAINI} = "/usr/local/etc/vertica.ini";
        my $user = 'dbadmin';
        my $pass = 'dbadmin';
        my $attr = {
                RaiseError => 1, # Make database errors fatal to script
                AutoCommit => 0, # Prevent statements from committing transactions;
        };

        my $driver = "/opt/vertica/lib64/libverticaodbc.so";
        my $db = "VMARTDB";
        my $servername = "VerticaNode01";
        my $uid = "dbadmin";
        my $pwd = "masked";
        my $port = "5433";
        my $locale = "ja_JP";
        my $connect = "dbi:ODBC:Driver=$driver;Servername=$servername;Database=$db;UID=$uid;PWD=$pwd;Port=$port;Locale=$locale";

        my $self = {};

 

        # if replacing with undef, then there is no warning message at all.
        $self->{dbObj} = DBI->connect($connect, undef, undef, $attr);
        if (!($self->{dbObj})) {
                return (undef, DBI::errstr);
        }

        bless($self, $cls);

        return $self;
}

 

 

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file