天天看点

SAP HANA AFL插件库升级后之前生成的存储过程升级方法(PAL升级方法)

在AFL库升级之后,之前创建的存储过程需要进行相应的升级,这个时候一般需要重新运行AFL_WRAPPER_GENERATOR。在前面的例子中,我们知道在重新运行该存储过程的时候,因为之前已经生成相应的存储过程,则一定会报错。如何应对这种情况?

SAP HANA提供两种方法:

1. 手工删除之前的存储过程及表类型,再重新运行AFL_WRAPPER_GENERATOR。该方法在之前的文章中已有提及:

<a href="http://www.cnblogs.com/omygod/archive/2013/05/04/3059728.html">http://www.cnblogs.com/omygod/archive/2013/05/04/3059728.html</a>

DROP PROCEDURE _SYS_AFL.PAL_TS_S;

DROP TYPE _SYS_AFL.PAL_TS_S__TT_P1;

DROP TYPE _SYS_AFL.PAL_TS_S__TT_P2;

DROP TYPE _SYS_AFL.PAL_TS_S__TT_P3;

CALL SYSTEM.AFL_WRAPPER_GENERATOR ('PAL_TS_S', 'AFLPAL', 'SINGLESMOOTH', PAL_TS_SIGNATURE);

2. SAP Note 1830239提供解决方法,该文主要从该方法进行探讨

SAP Note 1830239具体内容为:

Summary

<b>Symptom</b>

You run AFL_WRAPPER_GENERATOR and get an error like:

"SAP DBTech JDBC: [423]: liveCache error: [423] SYSTEM.AFL_WRAPPER_GENERATOR: line 35 col 1 (at pos 1718): liveCache error exception: liveCache error: registration finished with errors, see indexserver trace"

And in the indexserver trace there is a message like:

"cannot use duplicate user-defined type name - PAL_TS_S__TT_P2: line 1 col 22 (at pos 21): line 1 col 22 (at pos 21)"

<b>Other terms</b>

AFL error, PAL

<b>Reason and Prerequisites</b>

You are using AFL_WRAPPER_GENERATOR to generate a procedure to call a PAL Application Function. The procedure was already generated before in a previous call to the wrapper generator. Now you are facing duplicates.

The PAL manual describes how all tables types and the procedure itself have to be dropped manually in advance. But this step  was not perfomed (successfully).

<b>Solution</b>

Instead of dropping all relevant table types and the procedure manually the counter part to AFL_WRAPPER_GENERATOR called AFL_WRAPPER_ERASER can be used.

Please proceed as follows:

1. Connect to the database as user SYSTEM via Hana Studio.2. Copy the attached file afl_wrapper_eraser.txt to a sql window and execute it.3. Grant the execution of afl_wrapper_eraser to the relevant user:

           grant execute on system.afl_wrapper_eraser to ...

4. Connect as this user and run system.afl_wrapper_eraser for the procedure causing trouble.

<a></a>

Header Data

Release Status:

Released for Customer

Released on:

05.04.2013  11:20:16

Master Language:

English

Priority:

Correction with medium priority

Category:

Program error

Primary Component:

BC-DB-HDB-AFL SAP HANA Application Function Library

Affected Releases

Release-Independent

该Note所阐释的方法如下:

1. 生成系统存储过程AFL_WRAPPER_ERASER。sql语句如下:

GRANT EXECUTE ON SYSTEM.AFL_WRAPPER_ERASER TO User1;

该方法会删除方法及相应的table type。

3. 重新运行AFL_WRAPPER_GENERATOR。

实例如下:

CALL SYSTEM.AFL_WRAPPER_ERASER ('PAL_TS_S');

专注于企业信息化,最近对股票数据分析较为感兴趣,可免费分享股票个股主力资金实时变化趋势分析工具,股票交流QQ群:457394862

本文转自沧海-重庆博客园博客,原文链接:http://www.cnblogs.com/omygod/archive/2013/05/04/3059841.html,如需转载请自行联系原作者