Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by Xaositect (Friar)
on Jul 15, 2005 at 18:00 UTC ( #475309=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://475309]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2020-10-29 06:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (269 votes). Check out past polls.

    Notices?