https://bugs.documentfoundation.org/show_bug.cgi?id=116936

--- Comment #4 from Lionel Elie Mamane <lio...@mamane.lu> ---
To test: create a firebird-embedded database; put some data in it

Create a Basic macros like and run the Tst macro

Sub ensureConnection()
        Dim DBDocUI as Object
        DBDocUI = ThisDatabaseDocument.currentController
        if not DBDocUI.isConnected then
                DBDocUI.connect
        end if
End Sub

Function get_stmt() as Object
        ensureConnection()      
        get_stmt =
ThisDatabaseDocument().currentController.ActiveConnection.createStatement()
End Function

Sub Tst
    dim rs as Object
    dim stmt as Object
    stmt = get_stmt()
    rs = stmt.executeQuery("SELECT * FROM table_name ORDER BY XXXX")
    rs.next()
    rs.updateString(2, "new value")
    rs.updateDate(3, CDateToUnoDate(DateSerial(2020,05,25)))
    rs.updateRow()
    ' this should have set the second column of the first row of table_name to
"new value"
    ' and the third column to the date 25 May 2020
    ' note that first column is column 1

    ' similarly test updateInt, updateTime, updateLong, updateTimestamp,
updateNull, updateDouble, etc
    ' see
https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1sdbc_1_1XRowUpdate.html#a663cf96bf1e722231ffd2587a3ef9103

    Dim col as Object
    col=rs.columns.getByIndex(1) ' fetch the _second_ column. First column is
index 0
    col.updateString("new new value")
    rs.updateRow()
    ' this should have set the second column of the first row of table_name to
"new new value"
    ' and I'm already cheating you a bit, because I'm increasing the scope of
this enhancement :)
    ' this will require to implement the same updateXXXX in Column.cxx
End Sub

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to