'Multiple SQL statements in a single API call are not supported; use one API call per statement instead

I have a stored procedure in which we pass SQL to execute like

set variable;

insert to table 

select from abc;

update abc table;

this is returning me below error

Multiple SQL statements in a single API call are not supported; use one API call per statement instead.

there are 3 statements to be executed in sql.execute in stored procedure.



Solution 1:[1]

If you are using new SQL stored procedures you can enclose all dynamic code into BEGIN … END blocks, this should allow all code to be executed as one.

You can also try increasing the MULTI_STATEMENT_COUNT limit for the session or user on which you are executing this code.

ALTER USER <UserName> SET MULTI_STATEMENT_COUNT = 0;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Michael Golos