Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8950

Re: HCP Trial - PAL: AFL Error [423] when creating wrapper

$
0
0

Hi Julian,

 

I also tried to execute the PAL function in HCP trial and finally it succeed..

 

I think there are two main differences of the usage:

1. find the schema where you can create the required table or table type.

2. create procedure with the HCP AFL wrapper generator

 

Here is the script which I execute successfully in HCP trial . I tried it successfully again few minutes ago:)

 

You can replace all the schema name "NEO_D29KICVQSCRTK9RDQX8PJE72Y" with your own schema (the result from the first query) .

Hope it could help.

 

-- Find the schema
SELECT SCHEMA_NAME FROM "HCP"."HCP_DEV_METADATA" ;
SET SCHEMA NEO_D29KICVQSCRTK9RDQX8PJE72Y;
-- 1. Create required table type and table
DROP TYPE PAL_KMEANS_DATA_T;
CREATE TYPE PAL_KMEANS_DATA_T AS TABLE( "ID" INTEGER, "V000" DOUBLE, "V001" VARCHAR(2), "V002" DOUBLE);
DROP TYPE PAL_KMEANS_ASSIGNED_T;
CREATE TYPE PAL_KMEANS_ASSIGNED_T AS TABLE( "ID" INTEGER, "CLUSTER" INTEGER, "DISTANCE" DOUBLE);
DROP TYPE PAL_KMEANS_CENTERS_T;
CREATE TYPE PAL_KMEANS_CENTERS_T AS TABLE( "CLUSTER_ID" INTEGER, "V000" DOUBLE, "V001" VARCHAR(2), "V002" DOUBLE);
DROP TYPE PAL_CONTROL_T;
CREATE TYPE PAL_CONTROL_T AS TABLE( "NAME" VARCHAR (100), "INTARGS" INTEGER, "DOUBLEARGS" DOUBLE, "STRINGARGS" VARCHAR (100));
DROP TABLE PAL_KMEANS_PDATA_TBL;
CREATE COLUMN TABLE PAL_KMEANS_PDATA_TBL("ID" INTEGER, "TYPENAME" VARCHAR(100), "DIRECTION" VARCHAR(100));
INSERT INTO PAL_KMEANS_PDATA_TBL VALUES (1, 'NEO_D29KICVQSCRTK9RDQX8PJE72Y.PAL_KMEANS_DATA_T', 'in');
INSERT INTO PAL_KMEANS_PDATA_TBL VALUES (2, 'NEO_D29KICVQSCRTK9RDQX8PJE72Y.PAL_CONTROL_T', 'in');
INSERT INTO PAL_KMEANS_PDATA_TBL VALUES (3, 'NEO_D29KICVQSCRTK9RDQX8PJE72Y.PAL_KMEANS_ASSIGNED_T', 'out');
INSERT INTO PAL_KMEANS_PDATA_TBL VALUES (4, 'NEO_D29KICVQSCRTK9RDQX8PJE72Y.PAL_KMEANS_CENTERS_T', 'out');
GRANT SELECT ON NEO_D29KICVQSCRTK9RDQX8PJE72Y.PAL_KMEANS_PDATA_TBL to SYSTEM;
--CALL "SYS".AFLLANG_WRAPPER_PROCEDURE_DROP('NEO_D29KICVQSCRTK9RDQX8PJE72Y', 'PAL_KMEANS_PROC');
--CALL "SYS".AFLLANG_WRAPPER_PROCEDURE_CREATE('AFLPAL', 'KMEANS', 'DM_PAL', 'PAL_KMEANS_PROC', PAL_KMEANS_PDATA_TBL);
-- 2. Use HCP wrapper generator to create the procedure
CALL "HCP"."HCP_AFL_WRAPPER_ERASER"('PAL_KMEANS');
CALL "HCP"."HCP_AFL_WRAPPER_GENERATOR"('PAL_KMEANS','AFLPAL', 'KMEANS', PAL_KMEANS_PDATA_TBL);   -- cannot configure the target schema? suffix, AFL area, function, signature table
-- 3. prepare to call the kmeans
DROP TABLE #PAL_CONTROL_TBL;
CREATE LOCAL TEMPORARY COLUMN TABLE #PAL_CONTROL_TBL( "NAME" VARCHAR (100), "INTARGS" INTEGER, "DOUBLEARGS" DOUBLE, "STRINGARGS" VARCHAR (100));
INSERT INTO #PAL_CONTROL_TBL VALUES ('THREAD_NUMBER', 2, null, null);
INSERT INTO #PAL_CONTROL_TBL VALUES ('GROUP_NUMBER', 4, null, null);
INSERT INTO #PAL_CONTROL_TBL VALUES ('INIT_TYPE', 1, null, null);
INSERT INTO #PAL_CONTROL_TBL VALUES ('DISTANCE_LEVEL',2, null, null);
INSERT INTO #PAL_CONTROL_TBL VALUES ('MAX_ITERATION', 100, null, null);
INSERT INTO #PAL_CONTROL_TBL VALUES ('EXIT_THRESHOLD', null, 1.0E-6, null);
INSERT INTO #PAL_CONTROL_TBL VALUES ('CATEGORY_WEIGHTS', null, 0.5, null);
DROP TABLE PAL_KMEANS_DATA_TBL;
CREATE COLUMN TABLE PAL_KMEANS_DATA_TBL LIKE PAL_KMEANS_DATA_T;
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (0, 0.5, 'A', 0.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (1, 1.5, 'A', 0.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (2, 1.5, 'A', 1.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (3, 0.5, 'A', 1.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (4, 1.1, 'B', 1.2);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (5, 0.5, 'B', 15.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (6, 1.5, 'B', 15.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (7, 1.5, 'B', 16.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (8, 0.5, 'B', 16.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (9, 1.2, 'C', 16.1);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (10, 15.5, 'C', 15.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (11, 16.5, 'C', 15.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (12, 16.5, 'C', 16.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (13, 15.5, 'C', 16.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (14, 15.6, 'D', 16.2);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (15, 15.5, 'D', 0.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (16, 16.5, 'D', 0.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (17, 16.5, 'D', 1.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (18, 15.5, 'D', 1.5);
INSERT INTO PAL_KMEANS_DATA_TBL VALUES (19, 15.7, 'A', 1.6);
DROP TABLE PAL_KMEANS_ASSIGNED_TBL;
CREATE COLUMN TABLE PAL_KMEANS_ASSIGNED_TBL LIKE PAL_KMEANS_ASSIGNED_T;
DROP TABLE PAL_KMEANS_CENTERS_TBL;
CREATE COLUMN TABLE PAL_KMEANS_CENTERS_TBL LIKE PAL_KMEANS_CENTERS_T;
-- 4. Call the procedure
CALL "_SYS_AFL"."NEO_D29KICVQSCRTK9RDQX8PJE72Y_PAL_KMEANS"(PAL_KMEANS_DATA_TBL, #PAL_CONTROL_TBL, PAL_KMEANS_ASSIGNED_TBL, PAL_KMEANS_CENTERS_TBL) with OVERVIEW;
SELECT * FROM PAL_KMEANS_ASSIGNED_TBL;
SELECT * FROM PAL_KMEANS_CENTERS_TBL;

Viewing all articles
Browse latest Browse all 8950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>