How to check user input text is not in already in SQL results

Hello Forum,

Could you suggest me some post or link where I can see how to make a comparison between an input text and the result of a query made to an SQL table?
The result of the query is a column extracted from an SQL Table in which each raw corrispond to a string to which my input text needs to be compared. If the new inserted text input (CODIFICA) is equal to one of the already existing I need to give a message and ask to choose another input text.

See example:

QUERY RESULT VALID INPUT TEXT NOT VALID INPUT TEXT
AAA FFF CCC
BBB
CCC
BGA1
BGA2

When a NOT valid input text is inserted, an alert message must be displayed.

In the above flow there is the check if the input text is empty, I need to add the described other check.

Thank a lot

You would be better to do that in the sql query by using a WHERE clause to fetch any records where the column value is equal to the value to be tested. Then if it returns nothing you you know it does not already exist.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.