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

Error while executing Store procedure

Open jainmnsh opened this issue 10 years ago • 1 comments

Hi Guys,

I am able open the connection and able to execute the sql fine but when I am trying to execute the procedure, its just returning very generic message. any help will be appreciate..

Error: ORA-00900: invalid SQL statement

below is my code. sql = "EXECUTE xxxxx ( '2022', :1 );"; // callback(null, 'Success'); oracle.connect(connString, function (err, connection) { if (err) { logger.error('connection Error ' + err); callback(err, null); } else { logger.debug('connection success'); connection.execute(sql, [new oracle.OutParam(oracle.OCCICURSOR)], function (err, results) { if (err) { logger.error('Error in execution of SP' + err); connection.close(); } else { connection.close(); logger.debug('Results ' + JSON.stringify(results)); callback(null, results); }

        });
    }

});

jainmnsh avatar Jan 27 '15 01:01 jainmnsh

EXECUTE is a SQL*Plus client command. It's not part of SQL or PL/SQL. Try using a BEGIN END block.

cjbj avatar Jan 27 '15 02:01 cjbj