Cursors (foiled again)
- From: gbostock@xxxxxxxxxx
- Date: Mon, 3 Dec 2007 13:43:20 -0800 (PST)
It's been a while since I did dbi, but I used to be quite proficient.
Now I'm back to it.
What I want to do is read a flat file that has a column value in it,
do a select on the database to find a corresponding column value and
then modify the flat file record based on that retrieved column
valuie.
So I'd have a perl function that basically does "select column1 from
table where column2 = (value in file) and returns the column value
selected.
I can do this with a prepare, execute, and fetchrow_array OK (and it
is really slow), but there's got to be a way to set up a select cursor
that is more efficient. I'm figuring it starts with a prepare on
something like "select column1 from table where column2 = ?" but
exactly how that is done is eluding me in terms of when the bind param
happens and how a different value is used each time a fetch is done.
Can anybody write (or direct me to) a simple example for me?
Thanks.
.
- Follow-Ups:
- Re: Cursors (foiled again)
- From: Jeff Zucker
- Re: Cursors (foiled again)
- Prev by Date: Db design tool: ModelRight
- Next by Date: Pedant at the London Perl Workshop
- Previous by thread: Db design tool: ModelRight
- Next by thread: Re: Cursors (foiled again)
- Index(es):