cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamic SQL query in SAP Data intelligence

amish1980_95
Participant
0 Likes
927

Hello Folks,

I am trying to write a dynamic SQL query in SAP Data Intelligence.

My requirement is to fetch 1000 records from Hana staging table and expose it to web, where user can edit the data. This data would be updated back in staging table. Once user clicks next then next 1000 records would be displayed on the web page exposed by API call.

I could filter the records based on limit and offset using the 'Run Hana SQL' operator but that is a static configuration.

Could anybody suggest on how to create the dynamic SQL query to provide limit and offset as parameters?

Thanks.

Indu Khurana.

Accepted Solutions (1)

Accepted Solutions (1)

architectSAP
SAP Mentor
SAP Mentor

Hello Indu,

You can use parameters in SAP HANA SQL:

select 'architectSAP' from dummy limit ${limit} offset ${offset}

amish1980_95
Participant
0 Likes

Thank You Frank for your response.It is really helpful.

I tried it in two ways , one through constant generator and other by passing the query in java script and it works.

Just a small question, can we alter a table to add primary key in the same pipeline in which we are creating the table through table producer. I tried it but it fails with error that the table does not exist.

As the number of columns are 200, I did not use HANA client operator.

Hence I kept the alter table in another graph and now I am trying to connect two graphs.

Is there a way to set primary key on HANA table without using static schema?
Also, how do we call graphs from one graph?

Regards,

Indu Khurana.

Answers (0)