papouchka Posted June 9, 2023 Report Share Posted June 9, 2023 Hello, I am testing the principle of calling a stored procedure in Unilogic 1.33.236 but I have a visible error message in the structure associated with the request: Status: -5 (Not documented in the Unilogic help) Status report : 2031 no data supplied for parameters in prepared statement I am working with a MySQL database. The connector is correctly configured. In PhpMyAdmin, I created a stored procedure to insert data in a table with the name of the dynamic table as described in this link: https://support.unitronics.com/index.php?/selfhelp/view-article/sql-dynamic-table-name but adapting it to MySQL. Here is the code for the stored procedure: DELIMITER $$ CREATE PROCEDURE `insert_data`(IN `idStation` INT, IN `ts` INT) BEGIN SET @varTable = CONCAT('bd_acquisition_',idStation); SET @query = CONCAT('INSERT INTO ',@varTable,'(`id_station`, `date_time`) VALUES(',idStation,',FROM_UNIXTIME(',ts,'))'); PREPARE dynQuery FROM @query; EXECUTE dynQuery; DEALLOCATE PREPARE dynQuery; END$$ DELIMITER ; I tested the call in phpmyadmin CALL insert_data(10,123456); and it works fine. I've tested the call in the LADDER code by giving input values in hardcodes directly in the SQL statement and it works very well (without checking "Is Executing Stored Procedure") But I'd like to provide the input values through the SQL Query block and that's where it gets stuck...The problem comes from the call with the placeholders. Nothing works: ? , :param , @param , With or without "Is Executing Stored Procedure". Does anyone have any ideas? Thanks in advance Quote Link to comment Share on other sites More sharing options...
papouchka Posted June 11, 2023 Author Report Share Posted June 11, 2023 Hello, I'll answer myself. In the call code for the procedure stored in Unilogic, there was a comment before the call that the server didn't like. By removing the comment, everything worked correctly. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.