1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
788 views
by oscar-p-6691 (550 points)

I am trying to run a stored procedure and I get this error:

TypeError: Cannot call method "getNode" of null in <Unknown Source>

Here is my code:

var qResult = qie.doQuery(

   "Database",

   "EXEC storedProcedure '"+acc+"', '"+insID1+"'");

var results = qResult.getNode('Result');

2 Answers

0 votes
 
Best answer
As explained by the awesome people in support, all I needed to do was add "SET NOCOUNT ON\n " before EXEC storedProcedure.  This returned the real result instead of a null result that an update in the stored procedure was providing.  They gave more details but this is the basics of it.
by oscar-p-6691 (550 points)
selected by oscar-p-6691
by david-f-5427 (1.7k points)
This topic, including this same answer, is discussed in greater depth at this KB question/answer: https://www.qvera.com/kb/index.php/709/is-it-possible-to-get-return-code-from-sql-stored-procedure?show=709#q709
0 votes

As of version .51, QIE adds support for calling stored procedures that do not contain SET NOCOUNT ON.

Examples can be found in this question:

How to call a stored procedures in QIE?

For reference the previous answers in this question use required either the stored procedure in the database server be updated to use the SET NOCOUNT ON or to send SET NOCOUNT ON to the server before the EXEC statement. 

by rich-c-2789 (17.6k points)
...