Hello,
I have a problem with SAP HANA SP10 (V102.04). Now I cannot use “create table as (select …)” in a procedure.
I have the following tests:
Test 1:
=====
createprocedure"SP_TEST_CreateTable"() as
begin
createcolumntable"Z_TABLE" as (select BUKRS from T001);
end;
The procedure cannot be compiled. I get a error message:
SAP DBTech JDBC: [258]: insufficient privilege: Not authorized
Test 2:
=====
But If I create the table outside procedure before. Then the procedure can be created. I don’t know, why.
createcolumntable"Z_TABLE" as (select BUKRS from T001);
createprocedure"SP_TEST_CreateTable"() as
begin
createcolumntable"Z_TABLE" as (select BUKRS from T001);
end;
Test 3:
=====
The procedure can be compiled and works, if I use dynamic sql.
createprocedure"SP_TEST_CreateTable"() as
begin
exec 'createcolumntable"Z_TABLE" as (select BUKRS from T001)';
end;
Question:
========
I didn’t have this problem with SP09 (V97.03). Is this a bug in SP10 (V102.04)? Is there a workaround without dynamic sql?
Regards,
Y. Hu