Calling mysql stored procedure

Hello everyone,

Version: 24.2.5.2 (X86_64) / LibreOffice Community
Build ID: bffef4ea93e59bebbeaf7f431bb02b1a39ee8a59
CPU threads: 16; OS: Windows 10.0 Build 26100; UI render: Skia/Raster; VCL: win
Locale: en-CA (en_CA); UI: en-US
Calc: threaded

I can easily send a query pr an update to MySQL, but I must be doing something wrong when it comes to calling stored procedures. Could anyone please put me on the right path? I tried using direct connection and JDBC with exactly the same results.

Try

oSQL_Command = oConnection.createStatement()
oResult = oSql_Command.executeQuery("CALL `matList`();")

Robert,

I tried several different types of combinations of these commands and locations of punctuation marks. Unfortunately no go.

Inspect the connection. Is there any connection to that database?

Instead of try and error, you should inspect your object variables. My statements do support method executeQuery(sql).

That error message is telling you that the function you are calling has not been implemented in the mysqlc connection driver code. Sometimes, the error message is thrown for the wrong reason, but it looks to be pretty clear here.

Was there ever a time when such a function call worked in the past?

Is the following of any use?

https://forum.openoffice.org/en/forum/viewtopic.php?f=21&t=41149

It ultimately boiled down to schema privileges in MySQL. I have just checked and it turns out that I had “execute” disabled under Object Rights for that particular user. Once I enabled this option and restarted Libreoffice, the following routine worked just fine.

And @Villeroy, you are 100% correct as my routine lacked any error checking. However, I did make sure, in advance, that the connection is actually there. Thank you for this.

image

1 Like

@marus_b : Code you created first couldn’t work, because line 10 is totally wrong:
oResult = oStatement.executeQuery( "CALL matList();")
would work, but never oConnection.executeQuery

You are 100% correct. My apologies for this.