I have to play the devil's advocate here :-)

If you're going to use DBI/DBD::??? to have perl interact with a database(whose "native" language is SQL), IMHO it's good(not bad) to actually know and use the SQL that your database uses. Again, IMHO, abstraction can be a good thing, but there is a limit - here's why I think using SQL in your code is good:
1. SQL is *NOT* that tough - if I can learn it and use it, then anyone can. And while some SQL(joins and there are more advanced topics that involve a learning curve) can be more challenging to learn for newbies, the basics (SELECT, INSERT, DELETE) are very straightforward. 2. Using Perl/DBI/DBD::?? to interact with a database sort of assumes that you already have a working database, which kind of assumes that you already know how to interact with the database on its own(without Perl/DBI/DBD::??). To do that, you should already have some familiarity with SQL, or you should learn SQL, at least enought to interact with your database through its "built in" client interface.
My my 1st database project, I didn't know SQL, nor did I know the MySQL database that I used for that project. But here's what I did:

* downloaded and installed MySQL * bought a book about MySQL(by Paul Dubois - excellent book) and read the online MySQL documentation, which is very good - I think it's at www.mysql.com(it's been a while - not sure about the address of that site) * learned enough SQL to be able to interact with MySQL using MySQL's client command line interface * installed DBI and DBD::mysql * read the excellent DBI perldocs by doing perldoc DBI at a command prompt * read the excellent DBD::mysql perldocs by doing perldoc DBD::mysql at a command prompt * bought the book "Programming the Perl DBI" by Tim Bunce and read it * wrote my 1st basic Perl/DBI/DBD::mysql application
It's been quite a while since I've read the DBI book, but I believe I remember that all the examples used straight SQL - there were no abstraction layers used like DBD::SQLite. Using these simple methods, I learned SQL and created my Perl/DBI/DBD::mysql using SQL, and you can too - it's really pretty easy.

So, my advice(just my humble opinion) is to just use SQL in your DBI applications - don't use an SQL abstraction like DBD::SQLite. Learning SQL will enable you to use any SQL database, since the SQL syntax is 95% the same between different SQL databases. Using DBD::SQLite means that you'll have to learn the syntax of DBD::SQLite, and then you'll be dependent on using that module for any database app you write. HTH.

In reply to Re: Re: To DBI or not to DBI by hmerrill
in thread To DBI or not to DBI by rzward

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.