in reply to Re^3: Death and Return of TIMTOWTDI
in thread Death and Return of TIMTOWTDI

You're right - you have no idea what you're talking about. DBI and SQL have nothing to do with each other; they are orthogonal technologies. The only link between them is that they are both related to RDBMSs in some way. DBI has to do with how to physically pass messages to a given database. SQL has to do with how you ask a database a question. DBM (which is mostly unrelated) has to do with how to store information in a database. When you use DBI, you generally pass messages written in SQL.

So, please, master of wise archain arts. How is passing messages to a Database different from asking it questions? As I recall there are also the 'update' and 'insert' statements that do not sound like questions to me. They seem to imply commands to me.

This post is not meant to be beillegerant, it is meant to ask a question so that I might learn more.

-- Jamie Payne

Replies are listed 'Best First'.
Re^5: Death and Return of TIMTOWTDI
by mpeppler (Vicar) on Jul 04, 2004 at 09:30 UTC
    DBI is an API used to connect to a data source, and pass it commands. SQL is a language used to interact with a certain class of database sources. So you use DBI to send SQL to the server, if your server speaks SQL and there is a DBI driver available for it.

    Michael

      So, the API that MySQL and PostgresSQL provide to interact with their database products are considered DBI?

      This seems silly and logical both at the same time... but still par for the course in the computer world

      Of course, I never really did figure out email, which I _think_ is a similar thing (I never really figured it out), what with POP3, IMAP, MTA, MDA, STMP, DNS, and half a dozen other protocals required just to get an email from point A to point B

      (Sorry, I do not mean to be belligerent, I just challenge people's response when it doesn't make sense in hopes they answer with something to make it make sense)

      -- Jamie Payne
        So, the API that MySQL and PostgresSQL provide to interact with their database products are considered DBI?
        No. MySql, Postgres, Sybase, Oracle, etc. provide C, Java, etc. APIs. DBI is a generic Perl API for database access, and DBD::mySQL, DBD::Sybase, etc provide mappings between the DBI API and the vendors C API.

        As for email - well I think you're mixing up a lot of different stuff...

        Michael

Re^5: Death and Return of TIMTOWTDI
by dragonchild (Archbishop) on Jul 04, 2004 at 20:35 UTC
    When using DBI to communicate with a database, you pass messages. Those messages could be commands, questions, whatever. There are other APIs for any given database. DBI is just way of abstracting away the different ways to communicate to different databases. However, talking with an Oracle database is different from talking with a MySQL database. They have implemented the language SQL in subtly different ways.

    Every command and every question is a message. Computer programs don't make a differentiation between them. Humans do.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

    I shouldn't have to say this, but any code, unless otherwise stated, is untested

      So, would SQL and DBI compliment or compete against each other? If they compliment each other, I fail to really see it in your post. If they compete against each other, well, this is a good example :)

      -- Jamie Payne
        They don't solve the same problem. DBI is a communication protocol. SQL is an application language. You can use DBI to communicate with databases that don't speak SQL and you can use SQL without using DBI, using other communication protocols.

        Think about it this way - you speak English. You can trasmit that English using your voice or the written word. You can also use those mechanisms to communicate in German. So, what is the relationship between English and your voice? That is the same relationship between SQL and DBI.

        ------
        We are the carpenters and bricklayers of the Information Age.

        Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

        I shouldn't have to say this, but any code, unless otherwise stated, is untested