Issue 61896

Summary: Issue:61869, HSQL access and update via Makro
Product: App Dev Reporter: sarotti <joerg.leistikow>
Component: apiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues, lars_o_hansen, marc.neumann
Version: 3.3.0 or older (OOo)Keywords: oooqa
Target Milestone: ---   
Hardware: All   
OS: Windows 98   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description sarotti 2006-02-10 12:51:08 UTC
This issue based on Issue 61869 - I don´t know the correct contact person/
programmer):

Using a makro to access and update HSQL databases produces an error. Here is the 
macro code (P.S. please see below the comments of marc):

Sub ResetTMP
 
Dim DatabaseContext as Object
Dim s as string
Dim oDatenquelle as Object
Dim oHandler as Object
Dim oDatVerb as Object
Dim oStatement as Object
Dim oErgSet as Object
Dim sSQL as String
 
 
DatabaseContext = createUnoService("com.sun.star.sdb.DatabaseContext")
oDatenquelle = DatabaseContext.getByName("Adress_db")
 
If not oDatenquelle.IsPasswordRequired Then
oDatVerb = oDatenquelle.getConnection("","")
else
oHandler = oDatenquelle.createUnoService("com.sun.star.sdb.InteractionHandler")
oDatVerb = oDatenquelle.ConnectWithCompletion(oHandler)
end if
 
oStatement = oDatVerb.createStatement()
oStatement.ResultSetConcurrency =
com.sun.star.sdbc.ResultSetConcurrency.UPDATABLE
oStatement.ResultSetType = com.sun.star.sdbc.ResultSetType.SCROLL_SENSITIVE

sSQL ="SELECT ""TMP1"", ""TMP2"", ""TMP3"" FROM ""TMP"""
 
oErgSet = oStatement.executeQuery(sSQL)
 
oErgSet.absolute(1)
 
REM die folgenden 3 Zeilen ändern den Inhalt der 1.-3.
Spalte des Ergebnisses der Abfrage "sSQL"
 
oErgSet.updateString(1, "text1") 'here you get the error
oErgSet.updateString(2, "text2")
oErgSet.updateString(3, "text3")
oErgSet.updateRow()

End sub
 
The error:
 
Basic runtime error
...exception....
Type: com.sun.star.sdbc.SQLException
Message: Function Sequence error.

Using other databases (like MS-Access)the update function with the macro will 
run.

best regards

- Jörg Leistikow -


------- Additional comments from msc Fri Feb 10 00:51:41 -0800 2006 -------


Hi,

I can reproduce this, reassign it to the right developer and set target.

Bye Marc
Comment 1 lars 2006-02-10 18:29:12 UTC
so, what's the difference? why a new issue?
Comment 2 stephan.wunderlich 2006-02-15 10:46:06 UTC
sw->oj: looks like one for you
Comment 3 martinschniewind 2006-03-08 17:10:23 UTC
See http://www.oooforum.org/forum/viewtopic.phtml?t=32812 for another code
example and further diagnostic details.
Comment 4 ocke.janssen 2006-03-09 07:16:55 UTC
The hsqldb sources doesn't allow at the moment other concurrency then read_only.
As workaround you could use a com.sun.star.sdb.RowSet to update your table. The
RowSet uses INSERT and UPDATE statements to achieve the task.