i want to store data returned from stored procedure to a table. i have tried this.
insert into table1 call sp_test();
but it fails.
how do i do this ?
i want to store data returned from stored procedure to a table. i have tried this.
insert into table1 call sp_test();
but it fails.
how do i do this ?
 
    
    Try this
call sp_test(@var)    
insert into table1 (select @var);
And in procedure there shoud be out variable in arguments
 
    
    If it returns data, it is a stored function, not a stored procedure. In that case you don't use CALL but simply use it in a INSERT … SELECT statement, like this:
INSERT INTO table1 SELECT sp_test()
 
    
    