On 11/13/07, Frank Barknecht fbar@footils.org wrote:
Hallo, Jamie Bullock hat gesagt: // Jamie Bullock wrote:
I would think that making it such that it acted like 'textfile', that with each bang sent to the sql object, that it would return each subsequent row, and once the end of that set is reached, it would output a bang on a second outlet, similar to what 'textfile' does.
Good idea! I'll add that too.
Actually I thought about this, too, but I'm not sure if it's really useful. One of the strengths of SQL is, that you can limit the result set manually. So if I'd want one row at a time, I'd design my SQL query as such using LIMIT, and if I want more rows, I'd just use a different LIMIT clause. Hardcoding this into the SQL class in my view doesn't make much sense. (Using the last outlet to signal the end of results like in [textfile] does make sense, though.)
Frank, this isn't hardcoding anything into the external. Any select query on a database has the potential of returning a single row, or a billion. The point of this is that each row contains a different set of data, and the PD program would process them sequentially. Getting all the rows at once would be very cumbersome programming in sorting out the data. Being able to process each row by itself is a little bit less daunting. Also, if you only get one row at a time from the database, that would be a LOT of querying, and the amount of time for each query might slow the system quite a bit.
Mike
Ciao
Frank Barknecht _ ______footils.org__
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev