SQL Request field - using WHERE = Item properties

  • 27 September 2017
  • 4 replies
  • 6 views

Badge +1

Dear All,

I am trying to fetch from a SQL Database users details based on the unique identifier. 

For that I want to use a SQL Request with a WHERE condition to return information corresponding to a given user: 

208561_pastedImage_1.png

The query run in "Run Now" if I manually input and replace the ID. But when the form load and that the Item Property ID should be set up in the SELECT statement then it doesn't.

I tried different syntax without success and I am now wondering if it is possible to use a Item Property inside the SQL Query ?

Does someone has any working experience of such case ?

Thank in advance,


4 replies

Userlevel 6
Badge +16

Have you tested it with a hardcoded ID?

Badge +5

Hi, ‌,
Value Field and Display Field should have used FIRST_NAME. This refers to the name of the column inside the table in the database that you were trying to retrieve.

Badge +5

Share with us what you can see afterwards. happy.png

Badge +1

This was indeed the problem, the documentation is absolutely not clear concerning this component..

Apparently the Value Field & Display Field refer to the SQL table's column name returned by the query.

(In the case that the SELECT command return two fields that would be a value and its name associated ..)

Not only these name would make sense only in a few scenarios but in addition this can work only if we are using the component as a Lookup where there is an association of Name - Value. Otherwise it seems that the value is lost if we set it up as a label.

I think it would be worth to update the SQL Request control component description, at least to indicate that these field should be the name of the SQL table column name returned by the Stored Procedure or Query.

Thanks for your help anyway happy.png

Reply