[WD20] SQL code

Startbeitrag von Luis Antonio Gutiérrez Flores am 11.08.2016 14:57

Good morning, I'm trying to do a simple query to a MySQL DB using the SQLWDR function, so I need the query to be created in the editor, the problem is I don't know how to pass parameters to it. My query is the following:

SELECT mantis_user_table.PASSWORD, mantis_user_table.id, mantis_user_table.username
FROM mantis_user_table
WHERE mantis_user_table.username = {username}

the {username} must be a parameter entered by the user, any help?

TIA

Antworten:

Hi

Are you looking for QueryName.UserName=Value before the execution?

Best regards

von Fabrice Harari - am 11.08.2016 15:01
Hello,

I'm not sure I'm understanding can you be a little more clear please? I execute the Query like this:

SQLExecWDR(QRY_Login,EDT_Usuario)

If I write QRY_Login. it doesn't autocomplete to the value
EDT_usuario is the parameter I need to pass to the query, I did this before by using SQLExec and stringbuild, but can't do that with SQLExecWDR :(

von Luis Antonio Gutiérrez Flores - am 11.08.2016 15:09
I managed to pass the desired parameter, but now Windev adds a letter "L" to my query where the parameter is passed, it tries to execute the next query:

SELECT mantis_user_table.username AS username , mantis_user_table.PASSWORD AS PASSWORD , mantis_user_table.enabled AS enabled , mantis_user_table.id AS id , mantis_user_table.access_level AS access_level
FROM mantis_user_table
WHERE ( mantis_user_table.username = L'testadmin')

von Luis Antonio Gutiérrez Flores - am 11.08.2016 17:15
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.