node-firebird icon indicating copy to clipboard operation
node-firebird copied to clipboard

Stored Procedure and Boolean Parameter

Open etiennesalomon opened this issue 8 years ago • 2 comments

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

etiennesalomon avatar Jan 12 '17 09:01 etiennesalomon

Hello any patch for fix this problem ?

ARDInformatique avatar Jan 30 '17 15:01 ARDInformatique

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.

cyyprezz avatar Jun 10 '20 16:06 cyyprezz