I’m starting to convert some of my current DB’s from HSQLDB to Firebird, but am having issues with Macros. Both HSQLDB and the Firebird DB’s are on the same PC so I have not selected “Enable Experimental features” in case this kills my working DB’s.
The first thing the Macro does is move to the last record in the table to check a field has the correct value, so I know all the data has imported correctly, as per the code extract below.
Context=CreateUnoService("com.sun.star.sdb.DatabaseContext")
DB=Context.getByName("DB Name")
Conn=DB.getConnection("","")
Stmt=Conn.createStatement()
Stmt.ResultSetType=com.sun.star.sdbc.ResultSetType.SCROLL_INSENSITIVE
Result=Stmt.executeQuery("SELECT *FROM TableName")
Result.last()
This works fine in HSQ but fails in Firebird at the last line with the error:
“An exception occurred
Type: com.sun.star.sdbc.SQLException
Message: The driver does not support the function ‘last not supported in firebird’
So is this a bug in the interpretor as Firebird is not fully rolled out and stable yet, or is it because I need to select “Experimental” which may be an issue if it kills the HSQ DB code. Or worse does Firebird really not support “Last()” in which case there will be a lot of re coding, if so where can I find a resource for code in an embedded Firebird in LO DB.