dbi Questions

2

Solved

I have searched google but could not find an answer to what I think is an easy question. I have a Perl code (example below) that gets data every 3 seconds and updates the received data into MySQL ...
Tallu asked 17/11, 2011 at 5:2

1

Solved

I have an application where the database rarely changes, and the application requires many reads from the database that is slowing down the performance quite significantly. Many of these reads are ...
Breault asked 30/9, 2011 at 10:1

1

Consider a simple mysql table with columns id (an integer) and flag (a boolean). A user interface written in JavaScript communicates to a CGI backend via JSON, both for receiving data from the tabl...
Eph asked 20/7, 2011 at 8:54

1

Solved

Besides handling error using standard code die "Unable to connect: $DBI::errstr\n" is it possible to write a custom code like below? Standard: $dbstore = DBI->connect($dsn, $user, $pw, {ora_s...
Middleweight asked 11/7, 2011 at 11:30

3

Solved

This is a standard inserting example from DBI manual: my $query = q{ INSERT INTO sales (product_code, qty, price) VALUES (?, ?, ?) }; my $sth = $dbh->prepare($query) or die $dbh->errstr;...
Pernickety asked 24/6, 2011 at 1:41

3

Solved

im using DBI in Perl to connect to my PostgreSQL Database. Everything is working fine but in my debugging (printing results etc.) iam not able to see if the query prepared by perls DBI module is re...
Envelop asked 4/5, 2011 at 15:5

4

In the DBI documentation, this is the recommended code for executing a query many times: $sth = $dbh->prepare_cached($statement); $sth->execute(@bind); $data = $sth->fetchall_arrayref(@at...
Churn asked 4/4, 2011 at 21:7

4

Solved

Would you call parts of the disconnect-code as line-noise or would you leave it as it is? use DBI; my $dbh = DBI->connect ... ... ... END { $dbh->disconnect or die $DBI::errstr if $dbh; } ...
Bremerhaven asked 16/3, 2011 at 12:9

5

Solved

I'm currently reading Effective Perl Programming (2nd edition). I have come across a piece of code which was described as being poorly written, but I don't yet understand what's so bad about it, or...
Indican asked 12/1, 2011 at 11:10

5

Solved

I've connected to a MySQL database using Perl DBI. I would like to find out which database I'm connected to. I don't think I can use: $dbh->{Name} because I call USE new_database and $dbh-&g...
Arcadia asked 21/11, 2008 at 5:14

4

Solved

I was told by a colleague that executing an SQL statement always puts the data into RAM/swap by the database server. Thus it is not practical to select large result sets. I thought that such code ...
Atonic asked 12/11, 2010 at 16:37

2

Solved

This is a tricky one to explain (and very weird), so bear with me. I will explain the problem, and the fix for it, but I would like to see if anyone can explain why it works the way it works :) I ...
Fornicate asked 17/10, 2010 at 6:22

1

Is there a known problem with SQLite giving a "database is locked" error for a second query in a single transaction when using Perl DBD::SQLite? Scenario: Linux, Perl DBI, AutoCommit => 0, a subrou...
Extraditable asked 15/10, 2010 at 14:54

5

I know that: $sth->fetchrow_hashref returns a hashref of the fetched row from database, $sth->fetchrow_arrayref returns an arrayref of the fetched row from database, and $sth->fetchrow_a...
Steelhead asked 9/9, 2010 at 13:48

3

Solved

All over the place, especially in DBI, I see this message come up all the time. It's confusing, because the first thing that comes to mind is that the arguments I'm passing the function are set to ...
Holography asked 30/8, 2010 at 3:3

2

Solved

Using DBD::mysql with DBI, I am getting the following error when attempting to connect to the database. DBI connect('database=mydb:host=localhost','someuser',...) failed: Can't connect to local ...
Raucous asked 24/12, 2009 at 11:12

1

Solved

im interested in performing multiple database actions in parallel. I have played with Perl Parallel::ForkManager but not used it with any databases yet. I have read that database connectivity is no...
Vanda asked 27/6, 2010 at 11:40

4

Solved

I have a sql file test.sql used to run some SQL (create object / update / delete / insert) that can look like this CREATE TABLE test_dbi1 ( test_dbi_intr_no NUMBER(15) , test_dbi_name VARCHAR2(...
Sylph asked 5/8, 2009 at 12:29

3

Solved

I have a Perl script inserting data into Postgres according to a pipe delimited text file. Sometimes, a field is null (as expected). However, Perl makes this field into an empty string and the Post...
Zoosporangium asked 18/5, 2010 at 16:44

2

Solved

I am a bit new to the Devel::Cover module, but have found it very useful in making sure I am not missing tests. A problem I am running into is understanding the report from Devel::Cover. I've look...
Monazite asked 18/3, 2010 at 15:13

3

Solved

I'm trying to do this: $sth = $dbi->prepare('INSERT INTO table VALUES (?, ?, ?)'); $sth->execute( $var1, $var2 || 'NOW()', $var3 ); without any luck. Any ideas?
Kp asked 9/2, 2010 at 16:54

2

Solved

I am writing some Perl scripts to manipulate large amounts (in total about 42 million rows, but it won't be done in one hit) of data in two PostgreSQL databases. For some of my queries it makes go...
Blanton asked 23/2, 2010 at 4:49

5

Solved

Can someone please shed some light on what exactly is DBI and DBD? When should either one be used and the benefits of using one over the other.
Jaquelinejaquelyn asked 24/12, 2009 at 11:55

3

Solved

The following code seems to be just too much, for getting a single count value. Is there a better, recommended way to fetch a single COUNT value using plain DBI? sub get_count { my $sth = $dbh-&g...
Photoflood asked 1/11, 2009 at 9:41

2

Solved

I have tried with Perl fork manager and DBI . But i got the error DBD::mysql::st execute failed: Lost connection to MySQL server during query . Here the sample code: I want make query between low...
Gadson asked 28/7, 2009 at 8:35

© 2022 - 2024 — McMap. All rights reserved.