Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
SQL_BUFFER_RESULT

Posted by steef_zuid (steef_zuid), 18 March 2004
Hi,

I'd like to store results temporarily to be available for next statements. I the documentation I found the SQL_BUFFER_RESULT option but I cannot get it to work.
If I add the SQL_BUFFER_RESULT to my query it does not complain. But how can I refer to the  buffered data in my next query?

Thanks in advance

Posted by admin (Graham Ellis), 18 March 2004
My reading of the documentation is that it buffers the results from the query you are making in a temporary table, thus allowing the table(s) from which the query are derived to be safely released / unlocked earlier.  It does not provide a facility to perform a query once and pass through the result set several times.

Just stating the keyword is enough to run the extra functionallity, which does mean that your MySQL is going to need more memory / swap space.

Posted by steef_zuid (steef_zuid), 19 March 2004
Than I misunderstood the documentation about the SQL_BUFFER_RESULT. Is there an other way to store results between statements?

Posted by admin (Graham Ellis), 19 March 2004
There are times that I write applications that select from databases and provide two or more sets out outputs based on the same query.  If necessary in such cases, I run the query once and store the pertinant information into an array, list or hash (depending on the case and the language) from which the second and subsequent outputs can be generated.

If you have a case where a complex query run (say) once a day provides an information feed for the following 24 hours, there's nothing to stop you running a query and writing a new table from your application, with than new table being referenced for the 24 hours.  This is a widely accepted and quite common practise - although from your original question, I don't think you want this degree of persistance.

Posted by steef_zuid (steef_zuid), 19 March 2004
The second option you described sounds okee to me. Since a few days, I'm using version 4.1. I did not worked with the CREATE TABLE ... LIKE statement, but that should do the job I think.

thanks a lot!





This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho