Skip to main content
1-Visitor
November 14, 2017
Question

How to pass column name as parameter in sql query.

  • November 14, 2017
  • 2 replies
  • 2754 views

How to pass column name as parameter in sql query.                          

In my scenario I need to pass column name from mashup and want to display only that column data in grid.

PS : I have created a database thing which has a service that takes input as column name and fetch that column data .

When I pass parameter as shown in the image its returning the parameter name in place of data of the column.

Can anyone help how to pass column name from input parameter.




2 replies

5-Regular Member
November 20, 2017

Hello, Sudipta Jatta.

I found the article below which implies this is not a supported function of SQL Query.

https://www.ptc.com/en/support/article?n=CS237638

Unless I am misunderstanding your use case.

-- Craig A.

5-Regular Member
November 22, 2017

sudipta jatta​: Please replace [] with << >> to make query as below :

select <<EmployeeName>> from advancedanamoly_sh2;

Please be careful with the usage in query since it might opens up security risk with SQL injections at run time.

-Durgesh