dbi Questions
1
Solved
I am using mysql database which has only one table "data" with 17,151257 rows.This table has a column string. i want to print all the rows in which string column contains a particular query string ...
2
Solved
Consider the following table:
mysql> select * from vCountryStatus;
+-------------+------------+------+---------+--------+-----------------+
| CountryName | CountryISO | Code | Status | Symbol |...
1
Trying to set a value in PostgreSQL using Perl and DBI, and thus DBD::Pg.
I'm getting an odd error.
2013-05-23 19:02:36.641139500 updating status to 0
2013-05-23 19:02:36.641410500 DBD::Pg::st ex...
Eternal asked 24/5, 2013 at 1:45
3
What is the best way to construct sql with various number of WHERE conditions ?
My solution looks ugly:
my ($where, @values);
if ($phone_number)
{
$where = 'AND pnone_number=?';
@values = ($from...
6
I'm attempting to get DBD::MySQL working on Snow Leopard (v10.6.6). The default version of Perl that comes with the OS is v5.10.0. Since I've read that's 64-bit, I went ahead and downloaded and ins...
Emarie asked 27/1, 2011 at 20:59
2
At work we have a DBA who said his RAC working just fine, but the truth is it isn't. SQL IDEs like Toad or SQL Developer randomly dropping their connections (my suspicion is becouse of the inrorrec...
4
Solved
I have a .accdb file on my local machine and I am trying to connect to it and read some data from 3 tables within the DB. How do I establish the connection using Perl?
So far I have scraped togeth...
3
Solved
disconnect invalidates 1 active
statement handle (either destroy
statement handles or call finish on
them before disconnecting)
The following code which grabs data from MySQL gets executed s...
1
Solved
I'm having some memory leak issues in a perl script that I'm running for extended periods of time, where the amount of memory that perl is taking up just continues to grow. Because of this, I am tr...
Cobbie asked 12/11, 2012 at 4:16
1
Solved
I ran into a problem when running code similar to the following example:
my $rows = $dbh->do('UPDATE table SET deleted=NOW() WHERE id=?', undef, $id)
or die $dbh->errstr;
if (!$rows) {
# ...
7
Solved
I'm trying to basically do a search through the database with Perl to tell if there is an item with a certain ID. This search can return no rows, but it can also return one.
I have the following c...
4
sorry for my noob question,
I'm currently writing a perl web application with sqlite database behind it.
I would like to be able to show in my app query results which might get thousands of rows - ...
3
Solved
I want to insert null in a column in a table.
Which one represents null? undef or empty string ''.
Which one should be used and Why? I know about defined and that I can check it.
But I am lookin...
1
Solved
I have a need to be able to issue "create trigger" over DBI. I can't seem to get the delimiter command working. Can anyone find a way to make this work?
Code:
use strict;
use DBI;
my $dbargs = {m...
1
Solved
I am running Perl 5.10 on Ubuntu 10.04 and using perl DBI module.
I am trying to use the "AND" condition in "WHERE" clause in SQL Query under Perl DBI. I am using the DBD::CSV driver.
Please conso...
3
Solved
I'm trying to execute the following script:
#!/usr/bin/perl -w
use strict;
use DBI;
my $db = "Pg";
my $db_database = "whatever";
my $user = "whatever";
my $password = "whatever";
my $dbh = DBI-...
Monia asked 18/5, 2012 at 21:4
1
Solved
I'm trying to sort our some legacy code that serves two purposes. It uses DBI to create a database and later uses DBI to connect to that database. Unfortunately, it used the same code for each. Tha...
4
Solved
I have a Perl script that uses a DBI connection. I open and read the SQL script file using a sub routine. I am printing only one record, where I should have two more (three records total). How do I...
2
Solved
I'm working in a Perl script and I'd like to use named parameters to perform a query in a Postgres database. The DBI documentation says that's not portable:
Some drivers also allow placeholders ...
Impressionism asked 23/3, 2012 at 19:58
5
Solved
I have a Postgres table with more than 8 million rows. Given the following two ways of doing the same query via DBD::Pg, I get wildly different results.
$q .= '%';
## query 1
my $sql = qq{
SELEC...
Recur asked 13/2, 2012 at 23:16
3
Solved
I'm have Perl 5.8 installed on all of our servers and wanted to use the DBI and DBD::Oracle modules to access our databases. My main concern is with the newer versions of perl the DBI and DBD modul...
4
With DBI is there a way to determine if an executed statement handle for a SELECT statement will return any rows without fetching from it?
I.e. something like:
use DBI;
...
my $sth = $dbh->pre...
1
Solved
Is it somehow possible to use named placeholders where DBI allows @bind_values? E. g., I would like to make statements like:
my $s = $DB->selectcol_arrayref ("SELECT a FROM b
WHERE c = ? OR d ...
Sublease asked 25/12, 2011 at 0:10
3
Solved
Has anyone seen a DBI-type module for Perl which capitalizes, easily, on MySQL's multi-insert syntax
insert into TBL (col1, col2, col3) values (1,2,3),(4,5,6),...?
I've not yet found an interfa...
1
Solved
When dealing with persistant MySQL connections, the one problem is that they get dropped after a certain timeout (usually 28800 seconds).
DBIx::Connector seems to do the job of automatically reconn...
© 2022 - 2024 — McMap. All rights reserved.