Execute macro from stored procedure

Analytics
New Member

Execute macro from stored procedure

Hi,

I would like to ask you if it possible to execute upsert macro in stored procedure in teradara 15.10 and highter?

I tried to use DECLARE CURSOR (Macro Form). But I recieved the error message  [5526] SPL1007:E(L5), Unexpected text 'EXEC' in place of cursor SELECT statement.

 

SyntaxEditor Code Snippet

CREATE    PROCEDURE Config_Item_Insert(  )BEGIN
 
 DECLARE Ex CURSOR FOR EXEC grp_m_commission.MAC_TEST(par_Config_Item_Id,par_Config_Item_Env,par_Config_Item_Name);
 
OPEN Ex USING 'Item1', 'Production', 'SM_Name' ;
 
 CLOSE Ex;
 
END
;

 Thans for help.

1 REPLY
Highlighted
Junior Contributor

Re: Execute macro from stored procedure

The SP manual is for both SQL Stored Procedures and Embedded SQL, you must check if specific syntax is supported by SPs.

 

The example you showed is for Embedded SQL only, there's no way to EXEC a macro in a Stored Procedure, but you can move the macro's source code into the SP.