Skip to Content
0
Former Member
Feb 20, 2016 at 12:47 PM

Can not use “create table as (select …)” in a procedure with SP10 ?

391 Views

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:

=====

create procedure "SP_TEST_CreateTable"() as

begin

create column table "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.

create column table "Z_TABLE" as (select BUKRS from T001);

create procedure "SP_TEST_CreateTable"() as

begin

create column table "Z_TABLE" as (select BUKRS from T001);

end;

Test 3:

=====

The procedure can be compiled and works, if I use dynamic sql.

create procedure "SP_TEST_CreateTable"() as

begin

exec 'create column table "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