Error: Too many arguments: ‘{name}’ takes {takes}; the statement fails when it runs
A stored procedure is called with more arguments than its method or class query declares. A
member declared with args... is not reported. IRIS refuses to compile a CALL (SQLCODE
-370). For a function or a class query in FROM, IRIS compiles the class or routine, and
the member raises <PARAMETER> when the statement runs. The statement gets SQLCODE -149 for
a function and SQLCODE -400 for a class query. Pass only the arguments the member declares.
IRIS compiles the example. Checked without an environment, as --iris none.
Class Demo.SqlTooManyArguments
{
ClassMethod Twice(n As %Integer) As %Integer [ SqlProc ] //! A8061
{
Quit n * 2
}
ClassMethod Run() As %Integer //! A8061
{
&sql(SELECT Demo.SqlTooManyArguments_Twice(1, 2) INTO :result) //! A1935
Quit result
}
}