PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WEBDEV 2024 → Loading a table with UN QUERY
Loading a table with UN QUERY
Iniciado por Manuel, set., 19 2008 11:08 AM - 2 respostas
Publicado em setembro, 19 2008 - 11:08 AM
colleagues (as)

I have a control board to view the records of a database

The problem is that I need to do it through the client code.

I do so if it works well

mdatos1 is Data Source
HExecuteSQLQuery(mdatos1,
"SELECT ORDEN,FECHAO,DES,TOTAL,TIPO,CODIGO FROM ordenes WHERE CODIGO = ' 5072' ")

Table1..BrowsedFile = mdatos1

but I need the client indicating the code if I create a variable to store the value

m is string
m = DCUENTA

mdatos1 is Data Source
HExecuteSQLQuery(mdatos1,
"SELECT ORDEN,FECHAO,DES,TOTAL,TIPO,CODIGO FROM ordenes WHERE CODIGO = m ")

Table1..BrowsedFile = mdatos1

does not show anything, but if m has the correct value.

any idea

Thank you
Publicado em setembro, 19 2008 - 12:28 PM
Hi !

--------------------
On 19-Sep-2008, Manuel <soporte@kronoscr.com> wrote:

mdatos1 is Data Source
HExecuteSQLQuery(mdatos1,...
"SELECT ORDEN,FECHAO,DES,TOTAL,TIPO,CODIGO FROM ordenes WHERE CODIGO = m")
-----------------------

You should write your query like this :
SELECT ORDEN,FECHAO,DES,TOTAL,TIPO,CODIGO FROM ordenes WHERE CODIGO = '"+ m
+"'"
where '" is a single quote followed by a a double quote and
"'" is a double quote + a single quote + a double quote.
Why ?
Read the query with a fixed value, you did set the value between single
quotes, you have to do the same with variables !

Hope this helps !

--
Marcel Berman
Président of Be-Dev.be (www.be-dev.be) (Belgium)
Member of Wind'Asso's Board (www.windasso.org) (France)
Be-Dev.be et Wind'Asso are User's group of PC-Soft's products
Publicado em setembro, 19 2008 - 7:26 PM
Perfect

Thank you