Which Perl database interface should I use?
Is CPAN DBI the best database interface to use in Perl for general database use? Are there some better options? ...
Is CPAN DBI the best database interface to use in Perl for general database use? Are there some better options? ...
For some reason I am having troubles with a DBI handle. Basically what happened was that I made a special connect function in a perl module and switched from doing: do 'foo.pl' to use Foo; and then I do $dbh = Foo->connect; And now for some reason I keep getting the error: Can't locate object method "rollback" via package "...
I have a table in my pgsql database with columns named "type", "desc", and "start". When I call $dbh->column_info, only "desc" comes back quoted, whereas in pgAdmin3 all three of them are quoted. Is one of them wrong? ...
Hi All, I am having trouble with a very simple Perl process. I am basically querying an Oracle database and I want to load it into Excel. I have been able to use DBIx::Dump and it works. However, I need to be able to use a variety of Excel formatting tools. And I think Spreadsheet::WriteExcel is the best module that outputs to Excel ...
Our website uses Perl to provide a simple mechanism for our HR people to post vacancies to our website. It was developed by a third party, but they have been long since kicked into touch, and sadly we do not have any Perl skills in-house. This is what happens when Marketing people circumvent their in-house IT team! I need to make a simp...
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->{Name} only reports the database that I initially connected to. Is there any trick or do I need to keep track of the database name? ...
A quick search gave me this announcement of Parrot DBDI from January 2004 and a dbdi-dev mailing list which appears to be long dead. Is Parrot DBDI still being developed? Is anyone working on a different database API or interface for Parrot? ...
Simple question: How do I do this on one line: my $foo = $bar->{baz}; fizz(\$foo); I've tried \$bar->{baz}, \${$bar->{baz}}, and numerous others. Is this even possible? -fREW Update: Ok, the hashref is coming from DBI and I am passing the scalar ref into template toolkit. I guess now that I look more closely the issue is somethin...
I need to get a database connection through a firewall, and also limit what queries can be run. DBD::Proxy seems to be the perfect solution for this. However, I'm currently using DBIx::Class, and can't figure out how to hook them together. In particular, DBD::Proxy doesn't take SQL; it takes particular named queries. But DBIx::Class doe...
I am looking for a DBI (or similar) proxy that supports both SQL restrictions and transactions. The two I know about are: DBD::Proxy DBD::Gofer DBD::Proxy The problem I have found with DBD::Proxy is that its server, DBI::ProxyServer, doesn't just restrict queries coming in over the network (which I want), but it also restricts queri...
Maybe I'm not looking in the right places but I'd like to use SQL Server Compact 3.5 as a back-end for an existing Perl app that uses DBI (on Windows). I'm looking specifically at SQL Server Compact 3.5 because I'd like to use the existing support for it in MS Sync Framework to get started instead of the SQLite db I'm currently using. ...
I believe I have set up Pg properly, but my script doesn't seem to be connecting to the database. I am testing with: $database="networkem"; $user="postgres"; $password=""; $host="localhost"; $dbh = DBI->connect("DBI:Pg:dbname=$dbname;host=$host", $user, $password); My pg_hba reads: host all postgres 127.0.0.1 255.255.25...
I have some old perl code which recently stopped working on a FreeBSD box. The code which fails looks (in simplest form) like this: #!/usr/local/bin/perl -w use strict; use DBI; my $datasource = "DBI:mysql:dbname:hostname.domain.com"; my $user = "username"; my $pass = "password"; DBI->connect($datasource, $user, $pass); This fails...
I have a Perl script running on UNIX that uses DBI to connect to and retrieve data from a SQL Server database. The script looks like the following: $dbh = DBI->connect("dbi:Sybase:server=$connect;charset=UTF-8", $login, $password) or die("Couldn't connect to $connect as $login/$password: $DBI::errstr"); $sql = "use mydb"; $sth = $dbh-...
How do I find detailed documentation on the behavior of the sth_to_objects() method in the Class::DBI module? ...
I want to be able to pass something into an SQL query to determine if I want to select only the ones where a certain column is null. If I was just building a query string instead of using bound variables, I'd do something like if ($search_undeleted_only) { $sqlString .= " AND deleted_on IS NULL"; } but I want to use bound que...
Hi, I want to access MySQL through ruby on a shared linux server. I figure I need to use the DBI module, but I can't seem to access it. I installed it as follows: gem install -r dbi It couldn't install it in the normal location, since I'm on a shared server and don't have permission: WARNING: Installing to ~/.gem since /usr/lib/rub...
[Edited to use much simpler code which shows the problem] The following code gives a segmentation fault on the last line require 'rubygems' gem 'mysql' gem 'dbi' require 'dbi' require 'mysql' dsn = "DBI:Mysql:DATABASE:www.HOST.net" # redacted dbh = DBI.connect(dsn, "USERNAME", "PASSWORD") # redacted sth = dbh.execute("select * from ...
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 code: my $th = $dbh->prepare(qq{SELECT bi_exim_id FROM bounce_info WHERE bi_exim_id = '$exid'}); $th->execute(); if ($th->fetch()->[0] != $ex...
A medical office that I do work for uses MIS that does not have ODBC. There is an export function, however, and it seems to dump it into a "export.DB" file. In Windows, that is traditionally a Paradox database; however, in snooping around the directory architecture, it looks like there's a portable Sybase server. Is there any way to a...