Search code examples
node.jsnode-oracledb

node.js / oracledb driver limitations


Node.js ver: 9.2 Oracledb driver ver: 2.0.15 I have written an anonymous PL/Sql procedure with declaration, execution and exception sections of 200 lines of coding.

This runs perfectly fine when running directly on Oracle server or using any tool that can run it. However, running from within the .js file gives an error:

"detailed_message":"ORA-06550: line 1, column 3681:\nPL/SQL: ORA-00905: missing keyword\nORA-06550: line 1, column 3467:\nPL/SQL: SQL Statement ignored\nORA-06550: line 1, column 3736:\nPLS-00103: Encountered the symbol \"ELSE\" when expecting one of the following:\n\n ( begin case declare end exception exit for goto if loop mod\n null pragma raise return select update while with\n

Since the code runs fine on the server directly, I would not suspect any issues with the procedure itself. And I also have another anonymous procedure with less than 100 lines of code seems to run fine from .js file.

I would like to know if there is any limitations with the db driver running such a long procedure. (I would not want to store this procedure in the db either)


Solution

  • There's no artificial limit on the PL/SQL block size in node-oracledb.

    Check your syntax, e.g. quote handling. Note the current examples use backticks.

    If you're concatenating quoted strings together, make sure each string ends or begins with whitespace:

    "BEGIN " +
    "FORALL ... " +
    ...