http://qs321.pair.com?node_id=475309


in reply to Re: Differences in SQL syntax when using DBI (are there any)? And help on publishing module on CPAN.
in thread Differences in SQL syntax when using DBI (are there any)? And help on publishing module on CPAN.

Also watch out for database functionality differences. For example, with a transactional database (mysql is not) you will either want to add $dbh->commit() statements, or turn on autocommit when you set up the database handle, like:

$dbh = DBI->connect($dsn, $user, $password, { RaiseError => 1, AutoCommit => 1 });

In general, if the goal is to do database manipulation without writing any actual SQL, probably the purest implementation I've seen is Class::DBI.


Xaositect - Whitepages.com
  • Comment on Re^2: Differences in SQL syntax when using DBI (are there any)? And help on publishing module on CPAN.
  • Select or Download Code

Replies are listed 'Best First'.
Re^3: Differences in SQL syntax when using DBI (are there any)? And help on publishing module on CPAN.
by techcode (Hermit) on Jul 15, 2005 at 19:23 UTC
    Well Class::DBI folows different logic and IMHO somehow it feels strange - as the trs80 said : Class::DBI Intro
    Class::DBI can be a powerful way of interacting with your databases, but it really requires a large scale project to reap the benefits and be worth the performance hit you take vs. doing traditional SQL queries. When using Class::DBI you are adding dynamic accessors for much of the data and the overhead of the method calls for all your operations. The benefit is less code, referral integrity (cascading delete), rollbacks in non transaction databases, reduction in lines of code, and increased portability since Class::DBI handles the abstraction across multiple database sources. If you are working on a large scale database centric application or you want to learn more about OO Perl Class::DBI is a good place to start.
    I intended this for simple projects ...
Re^3: Differences in SQL syntax when using DBI (are there any)? And help on publishing module on CPAN.
by itub (Priest) on Jul 15, 2005 at 18:15 UTC