Skip to Content

How to filter rows based on values of row and column having same name?

Hi,

I have table with dynamic generated column names . These column of the table is system dependent . In one column , corresponding dynamic column

name is maintained as value . This may be confusing!

In the below table , column PARAMETERS has values which is same as other columns name i.e MATNR_LO,SERNR_LO,SERNR_HI,DATE_LO.

I have to filter column based on values corresponding to contents of parameters . Since the column name is not fixed , I can not use static sql to filter rows, is their any other way to map column name with the contents of column . Here I want to check content of Parameters and compare the value associated with the these parameters with the column like DATE_LO,DATE_HI, MATNR_LO etc.

Please suggest any option!!

Capture.PNG (69.8 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2013 at 04:31 PM

    Not sure I totally get what the goal here is, but you should be able to get what you want by querying system view TABLE_COLUMNS

    Filter on the schema and table name, and then you can join PARAMETERS from your source table to COLUMN_NAME from TABLE_COLUMNS.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Micha - certainly true, but keep in mind results from dynamic SQL cannot be returned as a result set bound to an output variable from a stored procedure (i.e. like scripted CalcViews). The impact is that BI clients cannot consume such procedures like normal HANA information models.

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.