Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Icon > Re: Generator "...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 6 Topic 132 of 189
Post > Topic >>

Re: Generator "Cleanup" Question

by Cp200205@[EMAIL PROTECTED] Nov 27, 2006 at 02:15 PM

> The fetching of the result sequence is not really a logical
> part of the generation of events from the result sequence,
> hence combining that (and the free of the result sequence)
> into a single procedure may not be the way to go.

I thought it work kind of well:

every person := dbi_conn_find(conn, "SELECT * FROM people") do
    displayPerson(person)

That prevented me from having to deal with having a var for storing the
result, doing the actual query, and freeing the query when I was done
with it.

However, I see now that's not possible, so I'll just omit the function
and use:

res := dbi_conn_query(conn, "SELECT * FROM people")
every person := dbi_result_fetch_next_table(res) do
  displayPerson(person)
dbi_result_free(res)

Add's two more lines and a declared var, no huge deal, just though the
other was rather nice.

Jeremy
 




 6 Posts in Topic:
Generator "Cleanup" Question
Cp200205@[EMAIL PROTECTED  2006-11-26 08:22:20 
Re: Generator "Cleanup" Question
gmt@[EMAIL PROTECTED] (G  2006-11-27 19:40:23 
Re: Generator "Cleanup" Question
espie@[EMAIL PROTECTED]   2006-11-27 20:45:30 
Re: Generator "Cleanup" Question
Steve Wampler <swample  2006-11-27 14:12:14 
Re: Generator "Cleanup" Question
Cp200205@[EMAIL PROTECTED  2006-11-27 14:15:29 
Re: Generator "Cleanup" Question
Steve Wampler <swample  2006-11-27 16:22:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 4:28:04 CDT 2008.