Skip to Content

Get Column Names from SAP DUMMY table

Hi,

How do I get Column Names from SAP DUMMY table in HANA?

When I execute query "SELECT * FROM DUMMY", I get result as 0 rows.

Thanks,

Shiraz

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Nov 05, 2019 at 08:54 PM

    DUMMY is a public synonym for system table "SYS"."DUMMY" and what you should receive from there is via SQL is one row with a value 'X' for one column called "DUMMY" as well if select with

    SELECT * FROM "DUMMY";

    Unless I missunderstood your question.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 06, 2019 at 04:35 AM

    Hello SHIRAZ AHMED,

    DUMMY table usually returns a single entry with value X as shown below, unless otherwise you already have a table with same name in the schema you will only get below entries.

    You can go through the below post for more details on the same.

    POST

    To fetch the column names of any table below query would help you.

    SELECT SCHEMA_NAME, TABLE_NAME, COLUMN_NAME, POSITION
    FROM SYS.COLUMNS
    WHERE SCHEMA_NAME = 'SYS' AND TABLE_NAME = 'DUMMY'
    ORDER BY POSITION;
    

    Regards!


    scn.png (3.1 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 06, 2019 at 10:57 PM

    Yes it doesn't have any columns other than DUMMY but you can write SQL statement where you can pick multiple columns in run time

    2019-11-06-15-53-59-eclipse-workspace-dummy-system.png

    2019-11-06-15-59-27.png


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.