Skip to Content
avatar image
Former Member

SAP HANA Error: Column names not allowed

Hi experts,

I am trying to build a stored procedure in content which contains the following statement:

CREATE TABLE "CCR"."STATUS_DUPLICATES"

AS

( SELECT

"OBJNR" ,

SUM("SUMMATION") AS TEST

FROM "

CCR"."P07_STATUS"

GROUP BY "OBJNR"

HAVING SUM("SUMMATION") > 1 );

I get the following error: sql syntax error: only column names allowed:

It appears that HANA does not like sum/max/min etc in the select statement when creating a table. Does anyone have a suggestion on how to over come this?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 25, 2016 at 01:39 PM

    Hi ,

    I tried its working.Please check if "CCR"."P07_STATUS" has any field called "SUMMATION".

    If you need column table use syntax create column table..

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 25, 2016 at 01:27 PM

    Hi,

    you are creating procedure yes

    CREATE PROCEDURE "CCR"."STATUS_DUPLICATES"

    AS

    BEGIN

    END;

    above one is the general syntax for create procedure

    Thanks,

    Phani..

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 26, 2016 at 01:46 AM

    Hi Yuveer,


    I tested followings and it works on hana version 1.00.122:

    create table t1 (i int, ii int);

    create table t1 (i int, ii int); create table t2 as (select i, sum(ii) as sumii from t1 group by i having sum(ii)>1);

    can you share the definition of CCR"."P07_STATUS"?


    Best regards,
    James

    Add comment
    10|10000 characters needed characters exceeded