question

Sean avatar image
0 Likes"
Sean asked Felix Möhlmann answered

What is the correct SQL syntax for this Database Connector Query?

Hi

I want to query value from database. In my database, cmd_sno is string data. It can work when I script in line 6. But cmd_sno needs look up from token in my case. Thus, I need convert num to string if I get different value. I script in line 4 and 5. The result show error. How can I modify script in line 4 and 5? Thank's.

sql-query.png

FlexSim 23.0.5
databasesql query
sql-query.png (43.0 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

You have to also put the single quotation marks ('..') around the string value in the query (like you did in line 6)

string query = "SELECT...cmd_sno='" + num + "'";
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.