Hi all,
I am trying to create a standard SQL procedure to encapsulate the configuration, creation and calling of a PAL procedure.
The current version of this procedure is :
drop procedure OutlierDetection;
create procedure OutlierDetection(in schemaName varchar(100),
in currentDimension varchar(100))
language SQLSCRIPT as
insertInto varchar(100);
var1 varchar(100);
var2 varchar(100);
var3 varchar(100);
begin
exec 'set schema '||:schemaName;
exec 'drop type DATA_T';
exec 'create type DATA_T as table("'||:currentDimension||'" VARCHAR(100), SUM_MEASURE DOUBLE)';
exec 'DROP TYPE OUTLIER_T';
exec 'create TYPE OUTLIER_T AS TABLE("'||:currentDimension||'" VARCHAR(100),"OUTLIERS" INT)';
exec 'DROP TYPE RESULT_T';
exec 'CREATE TYPE RESULT_T AS TABLE("MEAN" DOUBLE,"SD" DOUBLE)';
exec 'DROP TYPE CONTROL_T';
exec 'CREATE TYPE CONTROL_T AS TABLE("Name" VARCHAR(100), "intArgs" INT, "doubleArgs" DOUBLE,"strArgs" VARCHAR(100))';
DROP table SIGNATURE_TAB;
create column table SIGNATURE_TAB("ID" INT,"TYPENAME" VARCHAR(100),"DIRECTION" VARCHAR(100));
insertInto := :schemaName||'.DATA_T';
insert into SIGNATURE_TAB values (1,:insertInto,'in');
insertInto := :schemaName||'.CONTROL_T';
insert into SIGNATURE_TAB values (2,:insertInto,'in');
insertInto := :schemaName||'.RESULT_T';
insert into SIGNATURE_TAB values (3,:insertInto,'out');
insertInto := :schemaName||'.OUTLIER_T';
insert into SIGNATURE_TAB values (3,:insertInto,'out');
exec 'GRANT SELECT ON '||:schemaName||'.SIGNATURE_TAB to SYSTEM';
call SYSTEM.afl_wrapper_eraser('PALOutlierDetectionProcedure');
call SYSTEM.afl_wrapper_generator('PALOutlierDetectionProcedure','AFLPAL','VARIANCETEST', SIGNATURE_TAB);
end;
call OutlierDetection('I301605', 'CITY');
but executing the alf_wrapper_generator here:
call SYSTEM.afl_wrapper_generator('PALOutlierDetectionProcedure','AFLPAL','VARIANCETEST', SIGNATURE_TAB);
throws an error saying :
SAP DBTech JDBC: [7] (at 1793): feature not supported: Only table variable is allowed in input parameter in a nested call:
could you please tell me what's wrong? and how am I supposed to call the afl_wrapper_generator procedure from within the standard procedure?
Thanks & regards
Mohamed Ali