Stored Procedure and Boolean Parameter
Hi,
I have a problem when execute a stored procedure which have input parameter boolean.
example :
CREATE OR ALTER PROCEDURE TEST (
INPUT_BOOLEAN_PARAM BOOLEAN)
AS
BEGIN
END
run this js code :
Firebird.attach(config.firebird, function (err, db) {
if (err)
throw err;
// db = DATABASE
db.query('EXECUTE PROCEDURE TEST(?)', [true], function (err, result) {
console.log(err, result);
// IMPORTANT: close the connection
db.detach();
});
});
result :
Error: Dynamic SQL Error, SQL error code = -303, conversion error from string "1" at doCallback (c:\dev\xidea\srv\node_modules\node-firebird\lib\index.js:1236:18) at c:\dev\xidea\srv\node_modules\node-firebird\lib\index.js:2931:21 at c:\dev\xidea\srv\node_modules\node-firebird\lib\messages.js:151:25 at search (c:\dev\xidea\srv\node_modules\node-firebird\lib\messages.js:117:13) at c:\dev\xidea\srv\node_modules\node-firebird\lib\messages.js:54:21 at FSReqWrap.wrapper [as oncomplete] (fs.js:681:17) undefined
Thank you for your help
Hello any patch for fix this problem ?
Hey try this:
db.query("SELECT * FROM TEST(?)", [true], function(err, result) {
And you also have to add a suspend statement to the firebird procedure (at the end in this case).
The Boolean domain exists only in Firebird 3.0 or newer.