On 07/24/14 21:27, Vlad Khorsun wrote: > ----- Original Message ----- > From: "Mark Rotteveel" <[email protected]> > To: "For discussion among Firebird Developers" > <[email protected]> > Sent: Thursday, July 24, 2014 7:35 PM > Subject: Re: [Firebird-devel] setCursorName in IResultSet rather > thanIStatement > > >> On 23-7-2014 17:59, Adriano dos Santos Fernandes wrote: >>> Hi! >>> >>> After I reported an TCS fail to Alex in January, he moved this method >>> from IStatement to IResultSet. >>> >>> But I fail to understand. Not talking about implementation detail, but >>> about interface. >>> >>> IMO makes no sense to first open the cursor and then name it later. >>> >>> We can have two prepared statement, while the second uses the cursor >>> name of the first. But now we need to open the first before prepare the >>> second. >>> >>> Isn't this just wrong? >> I'd think so. This should clearly be a feature of the statement. This is >> for example also the case in JDBC, see >> http://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html#setCursorName-java.lang.String- >> >> If you look at the SQL standard (CLI), then setting the cursor name is >> also associated with the statement. It even explicitly says that >> assigning a cursor name to a statement that has an open cursor should >> raise an invalid cursor state exception. >> >> As far as I understand it, you can't have an IResultSet unless the >> result set is open, so setting the cursor name on an IResultSet is not >> very logical. > What about more than one simultaneously active result set produced by > the same statement ?
If we (in the future) provide access to this feature at DSQL level rules of naming cursor are definitely going to be changed. It's not good to have 2 cursors with same name. On my mind the best way is to support SQL CLI and enable support for changing cursor name in IStatement. At the same time already opened cursors should certainly keep a name which was set when cursor was opened. Currently (while having multiple opened cursor in a statement is not DSQL-supported) we may disable changing name when it has opened cursor. ------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
