Skip to Content
-1
Former Member
May 10, 2018 at 05:34 PM

I can't call schema & name procedure from variable

547 Views Last edit May 10, 2018 at 05:41 PM 2 rev

My Prodecure's schema and name are stored in a colum of table. In another procedure I put schema and name in variable, but I don't now How to call procedure from variable. Help Me

The table is:

SELECT NOMBRE_PROCEDURE FROM ETL_CONTROL.ALL_PROCEDURES WHERE CODIGO_PROCEDURE=1;

The anoter stored procedure is:

I can't to call procedure because the procedure's name is into a variable :( Please Help Me!

CREATE PROCEDURE "P1942494358"."LLAMA_PROCEDURE2"()
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
DEFAULT SCHEMA P1942494358
AS
BEGIN
DECLARE PROCEDURE1 varchar(200);

SELECT NOMBRE_PROCEDURE into PROCEDURE1 FROM ETL_CONTROL.ALL_PROCEDURES 
WHERE CODIGO_PROCEDURE=1;

CALL :PROCEDURE1||; --ERROR
--CALL ||:PROCEDURE1||; --ERROR
--CALL 'ETL_CONTROL.SP_CARACT'()';--ERROR
END;

Attachments

1.png (10.3 kB)
2.png (20.3 kB)