On 12/12/2012 10:56, Dmitry Yemanov wrote: > All, > > Firebird v3 supports scrollable cursors in PSQL and I'm going to surface > them at the DSQL level as well. However, there's a question about how > they should be declared. In PSQL, this is done in the cursor > declaration, as per SQL spec: > > DECLARE MY_CUR [SCROLL | NO SCROLL] CURSOR FOR (<select expr>) > > However, it doesn't fit DSQL queries and the SQL spec doesn't help here, > because it expects all result sets being opened via explicit cursors. > > Initially, I was going to add an optional [WITH SCROLL] clause to the > select expression syntax for this purpose. At the conference, Mark said > that he would hate to parse the SQL text to find whether it's scrollable > or not, in order to use the proper API calls. So some other solution is > needed. The one that was raised there - add statement level parameter > blocks to the new API and use one of the tags to indicate scrollability. > I don't have much against this idea, but I'd like to mention that SQL > parsing can be easily avoided with the initial idea as well - just call > isc_request_info() to ask whether the prepared query is scrollable or not. > > That said, the SQL solution has one more issue, though maybe a minor one > - it allows conflicting declarations in PSQL cursors. Possible > workarounds are:
The SQL solution has more issues: - No way to support scrollable EXECUTE BLOCK result (not sure if you gonna to implement this, but is theoretically possible) - Tools may need/want scrollable result with arbitrary queries issues by the user > a) disallow WITH SCROLL in PSQL at all > b) disallow WITH SCROLL in PSQL cursors > c) throw error for NO SCROLL and WITH SCROLL used together > > What are your opinions about the SQL level solution? Or do you think we > should go the statement parameter buffer way instead? Any other idea? I do think you can create a new IStatement flag in the new API. Check IStatement::PREPARE_*. BTW, what would be the new API methods to support it? Adriano ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
