Skip to Content
0

Error while calling AFL_WRAPPER_GENERATOR

Jan 03 at 10:42 AM

161

avatar image
Former Member

I am not able to use AFL_WRAPPER_GENERATOR while trying to write stored proc for PAL. Below is my SQLSCRIPT.

set schema workshop;

create column table pal_sv_signature (id integer, typename varchar(1000), direction varchar(100));

insert into pal_sv_signature values (1, 'WORKSHOP.PAL_T_SVM_DATA', 'IN');
insert into pal_sv_signature values (2, 'WORKSHOP.PAL_T_SVM_PARAMS', 'IN');
insert into pal_sv_signature values (3, 'WORKSHOP.PAL_T_SVM_MODEL', 'OUT');
insert into pal_sv_signature values (4, 'WORKSHOP.PAL_T_SVM_STATS', 'OUT');
insert into pal_sv_signature values (5, 'WORKSHOP.PAL_T_SVM_PLACEHOLDER', 'OUT');


CREATE TYPE PAL_T_SVM_DATA AS TABLE (CALENDAR_ID INTEGER, SALES_AMOUNT DOUBLE);
CREATE TYPE PAL_T_SVM_PARAMS AS TABLE (NAME NVARCHAR(256), INTARGS INTEGER, DOUBLEARGS DOUBLE, STRINGARGS NVARCHAR(1000));
CREATE TYPE PAL_T_SVM_MODEL AS TABLE (ROW_INDEX INTEGER, MODEL_CONTENT NVARCHAR(5000));
CREATE TYPE PAL_T_SVM_STATS AS TABLE (STAT_NAME NVARCHAR(256), STAT_VALUE NVARCHAR(1000));
CREATE TYPE PAL_T_SVM_PLACEHOLDER AS TABLE (PARAM_NAME NVARCHAR(256), INT_VALUE INTEGER, DOUBLE_VALUE DOUBLE, STRING_VALUE NVARCHAR(1000));

call system.afl_wrapper_generator ('MYPAL_SVM', 'AFLPAL', 'SVMTRAIN', pal_sv_signature);

And this is the error I get on the console.

Could not execute 'call system.afl_wrapper_generator ('MYPAL_SVM', 'AFLPAL', 'SVMTRAIN', pal_sv_signature)' in 54 ms 456 µs . 
SAP DBTech JDBC: [423]: AFL error: "SYSTEM"."AFLPM_CREATOR": line 11 col 5 (at pos 239): [423] (range 3) AFL error exception: AFL error: "SYSTEM"."AFL_WRAPPER_GENERATOR": line 61 col 5 (at pos 1844): "SYSTEM"."AFLPM_CREATOR": line 11 col 5 (at pos 239): AFL error: registration finished with errors, see indexserver trace 

Indexserver trace has the following:

[67401]{233887}[39/3254569] 2018-01-03 10:31:11.242077 i TraceContext     TraceContext.cpp(01017) : UserName=SYSTEM, ApplicationUserName=sumanb, ApplicationName=HDBStudio, ApplicationSource=csns.sql.editor.SQLExecuteFormEditor$2$1.run(SQLExecuteFormEditor.java:856);, StatementHash=ad47568fdfca960e8ffa9ce9abb9ac58, StatementExecutionID=844433523020659
[67401]{233887}[39/3254569] 2018-01-03 10:31:11.242068 e AFLPM            AFLPM_PackageManager_ParameterCheck.cpp(00812) : Column MODEL_CONTENT of 3rd table does not match AF metadata.
[67401]{233887}[39/3254569] 2018-01-03 10:31:11.242096 e AFLPM_SQL        AFLPM_SQLDriverObj_Registration.cpp(04284) : Registration of AFLLANG wrapper procedure "_SYS_AFL"."MYPAL_SVM" failed with error 'inconsistent parameter description'.
[67401]{233887}[39/3254569] 2018-01-03 10:31:11.242379 w SQLScriptExecuto se_eapi_proxy.cc(00561) : Error <exception 71000423: registration finished with errors, see indexserver trace
> in execution of internal statement: call SYS.AFLPM_CREATOR_NOTHROW_DEV(?, ?, ?, ?, ?)
[67401]{233887}[39/3254569] 2018-01-03 10:31:11.242702 e SQLScript        trex_llvm.cc(00263) : Llang Runtime Error: Exception::SQLException423: AFL error: "SYSTEM"."AFL_WRAPPER_GENERATOR": line 61 col 5 (at pos 1844): "SYSTEM"."AFLPM_CREATOR": line 11 col 5 (at pos 239): AFL error: registration finished with errors, see indexserver trace
  at main (line 197) ("SYSTEM"."AFLPM_CREATOR": line 11 col 5 (at pos 239))

Please let me know if I am missing something here.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member
Jan 09 at 09:21 AM
0

Hi,

I assume that you are using HANA 2 SPS02. In HANA 2 SPS02, you don't need to use the afl_wrapper_generator to call SVM. Please check the SVM sample code in the manual https://help.sap.com/viewer/2cfbc5cf2bc14f028cfbe2a2bba60a50/2.0.02/en-US/901a10d65c3d4c0d8f161b9245172576.html.

If you want to use the afl_wrapper_generator, please check the sample code for the previous revision like HANA 2 SPS01 or HANA 1 SPS12.

Best regards,

Xingtian

Share
10 |10000 characters needed characters left characters exceeded