I tried to do this code:
INSERT INTO table_name CALL procedure_name;
But it's not possible so i found something like this:
DECLARE q1 VARCHAR(10000);
SET q1 =
'INSERT INTO table_name '
|| 'CALL procedure_name' ||';';
EXECUTE IMMEDIATE q1;
But it's also doesn't work.
Someone know how to write it?
You can't insert the result of a CALL because an SP might return multiple result sets.
What's this SP actually doing, can you show the source code?
The SP return column of IDs (Integer) and I want to insert into table exists.
Maybe it's will be help to understand this code SQL, because i just want to convert exactly like this code and get the some data:
INSERT INTO table_name
Apparently form the few other posts the result of the call is an integer? And you are using Stored Procedure Language?
Declare Result1 INT;
Call <stored-proc>(..., :Result1);
insert into <table-name> values(:Result1);