Questions tagged [dbd]

DBD is a common prefix for all perl modules used as database drivers by the DBI module. These drivers hide the internals of different relational database management systems by providing a common API through the DBI module.

Access to relational databases in Perl is usually accomplished by the CPAN DBI module. See also DBI tag wiki entry.

DBI provides a common API for database access that uses separate drivers (DBD::*) internally to handle the specifics of different database management system implementations.

Some of the most popular DBD modules available on CPAN are:

DBD::MySQL
DBD::Oracle
DBD::Pg       (PostgreSQL)
DBD::ODBC
DBD::SQLite
DBD::Informix
DBD::Mock     (for testing purposes) 
DBD::CSV      (limited SQL access for CSV files)
DBD::JDBC
169 questions
1
vote
2 answers

How do I check if a database row exists using DBD::mysql and Perl?

I'm working with a MySQL database and need to check if a row is already there before deciding which queries to run. The table I'm working on is something like this: player(playerid, nickname, data1, data2, data3) Where "playerid" is an…
Gurzo
  • 707
  • 1
  • 8
  • 20
1
vote
2 answers

Why do I get "Can't call method "fetchrow_array" without a package or object reference"?

I have installed DBD::Pg version 2.17.1 but still still getting error while using below code $res = $conn->prepare($query); $res = $res->execute(); @tuple = $res->fetchrow_array; error: Can't call method "fetchrow_array" without a package or object…
Space
  • 7,049
  • 6
  • 49
  • 68
1
vote
1 answer

Convert ->numrows for use with DBD::mysql in Perl

I have some old code that uses the old Mysql library in Perl. Most of the time updating the code to use DBD::mysql instead works with no problems however I have run into an issue where ->numrows does not work. What should I do to get the same…
Joseph
  • 3,899
  • 10
  • 33
  • 52
1
vote
2 answers

MySQL, Perl DBI, execute() and locking (exact moment of locking)

I am working on a Perl / DBI / DBD / MySQL application. I am using InnoDB with transaction level "repeatable read" and "autocommit = 0". To protect data which I am manipulating against concurrent manipulation by other threads or connections, I am…
Binarus
  • 4,005
  • 3
  • 25
  • 41
1
vote
1 answer

Bulk Insert into Oracle XMLTYPE Using Perl

I'm using Perl DBD::Oracle to try and bulk insert an array of XML strings into an Oracle XMLTYPE column. I can get it to work if I bulk insert into a CLOB but when I try inserting into the XMLTYPE column via Strawberry Perl it crashes. Has anyone…
user3676476
  • 323
  • 2
  • 10
1
vote
1 answer

DBD::CSV: Returns header in lower case

I've got a problem with the module DBD::CSV v0.30. Since a update to the newes version, all headers in the fetchrow_hashref generated hash are lower case instead of mixed case. Finaly the data will be committed to a mysql database and the column…
Floopy-Doo
  • 130
  • 1
  • 1
  • 8
1
vote
0 answers

Perl can not connect to MySQL (with DBD::mysql) on RHEL 6.7

I have Perl installed on Linux RHEL: perl -v This is perl 5, version 12, subversion 2 (v5.12.2) built for x86_64-linux-thread-multi When I run command to see Perl modules installed: find `perl -e 'print "@INC"'` -name '*.pm' -print I can see…
Joe
  • 11,983
  • 31
  • 109
  • 183
1
vote
2 answers

Perl script to connect oracle database

I am new to Perl Programming and database connectivity. Can anyone please let me know step by step procedure to write Perl Script for Oracle Database connectivity. My Perl Verion is: This is perl 5, version 22, subversion 0 (v5.22.0) built for…
dambigan
  • 21
  • 1
  • 3
1
vote
3 answers

DBD::CSV: Problem with file-name-extensions

In this script I have problems with file-name-extensions: if I use /home/mm/test_x it works, with file named /home/mm/test_x.csv it doesn't: #!/usr/bin/env perl use warnings; use strict; use 5.012; use DBI; my $table_1 = '/home/mm/test_1.csv'; my…
sid_com
  • 24,137
  • 26
  • 96
  • 187
1
vote
1 answer

DBD::Oracle, Cursors and Environment under mod_perl

Need some help, because I can't find any solution for my problems with DBD::Oracle. So at first, this is the current situation: We are running Apache2 with mod_perl 2.0.4 at our company Apache web server was set up with a startup script which is…
LingLing
  • 42
  • 1
  • 9
1
vote
1 answer

Not able to install DBD::pg perl module

I am trying to install DBD::pg module on my linux ubuntu 12.04 machine but not able to do so. I am using download method as I am facing connectivity issues while installing it from CPAN terminal. when I run perl Makefile.PL it gives me…
Geetika
  • 47
  • 3
  • 8
1
vote
0 answers

Error using DBD::Oracle package with Parallel::ForkManager after migrating from 5.8 to 5.10

I had a simple perl scrip that runs some DB opertions on using DBD::Oracle package and also forks some processes. Child processes also connects with DB but creates there own DBH object. This was working fine until I migrated from Linux RH4 to Linux…
user1545583
  • 69
  • 1
  • 6
1
vote
1 answer

Bulk inserting to mysql DB table using perl

I am using a simple perl script to pupulate millions of rows in a mysql DB table. I'm using perl DBI and DBD::mysql with the script. Example code below my $dbh = DBI->connect(); my $sth; my $insert_com = "INSERT INTO TAB1…
afwsl2003
  • 25
  • 1
  • 5
1
vote
1 answer

Perl DBD::ODBC stuck using the same ODBC Driver Manager

I have a problem where-by I cannot get Perl DBD::ODBC to use unixODBC after re-compiling and re-installing. It had been previously installed. I had compiled DBD::ODBC to use the DataDirect ODBC Driver Manager. I now want to recompile it to use…
LokMac
  • 391
  • 2
  • 8
  • 17
1
vote
1 answer

How to use a user created function in n perl DBD::Oracle

I have created a function in oracle 11g r2, I would like to call that function while inserting a record. Following is my code block. my $SQL="insert into sample values ( :sno, :amount , :func )"; my $sth =$dbh->…