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


in reply to EZDBI is an easier interface to SQL databases

I went this route once, and while it worked nicely for Select, Update didn't seem to fit too well. After various attempts, I went back to using DBI for anything more than a quick query.

I'll be curious to see what you come up with. I'm sure you're much better at this than I :)

  • Comment on Re: EZDBI is an easier interface to SQL databases

Replies are listed 'Best First'.
Re: EZDBI is an easier interface to SQL databases
by Dominus (Parson) on Oct 10, 2001 at 21:29 UTC
    Says MikeB:
    I went this route once, and while it worked nicely for Select, Update didn't seem to fit too well.
    Hmm. It seems to me that it works better for update than for select, because with select there are a lot of different ways you might want to get the result back, but with update that is not an issue.

    You probably know something that I need to know. Do you remember what the problem with update was?

    --
    Mark Dominus
    Perl Paraphernalia

      I always returned an array of hashrefs, figuring if that wasn't enough I'd be using the standard interface :)

      It's been a while but I think the problem was that I was using Win32:ODBC, before I discovered DBI, so was trying to put the values directly in the SQL string rather than using placeholders. To get the data correctly escaped required finding the type of each field. IIRC, my approach was a little different in that I passed the hashref from the select back to the update.

      Of course, there's also the issue of how to handle updates to complex queries.

      When it got to the point where it seemed I was essentially recreating M$ ADO, with all it's problems, I decided it wasn't worth it to me. With DBI's RaiseError and fetchall_arrayref now available, I don't bother to use my old query module anymore even for simple selects.

      With DBI and placeholders, you can probably handle simple updates without much problem.

      I don't mean to sound discouraging. I'm rather hoping you find a way :)