|
| Iniciado por traccia, 14,mar. 2016 00:16 - 2 respuestas |
| |
| | | |
|
| |
| Publicado el 14,marzo 2016 - 00:16 |
Hi, I created a delete query (new --> query --> delete), but how I could use it? if I simply write:
HExecuteQuery(qry_del_test, hModifyFile+hQueryDefault) HFreeQuery(qry_del_test)
no records are deleted.
it would be pointless to use a "delete query" if i must write:
HExecuteQuery(qry_del_test, hModifyFile+hQueryDefault) for each qry_del_test hdelete(qry_del_test) end HFreeQuery(qry_del_test)
I'm just testing windev so, please, be indulgent for my ignorance  |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 67 mensajes |
|
| Publicado el 14,marzo 2016 - 14:13 |
Hi
Queries are super easy in Windev/Webdev especially with the built in Query builder.
Once you have defined the delete query all you need to do is
HExecuteQuery(qry_del_test)
If you defined some parameters/conditions for selecting the records to delete then you need to specify the query parameters first before executing the query for example:
qry_del_test.pQuantity = 3 Hexecutequery(qry_del_test)
(the above would be for example if you wanted to delete all records where quantity was = 3. pQuantity is defined as a parameter on the Quantity field within the query builder)
Can you share the SQL code of the query (qry_del_test) so people in the forum can help you better?
Gautam |
| |
| |
| | | |
|
| | |
| |
| Publicado el 16,marzo 2016 - 13:35 |
For the code... I used a database with 2 fields: "number" and "type" the query has 2 parameters param1 for number and param2 for type. So evidently it didn't work because I used:
HExecuteQuery(qry_del_test, hModifyFile+hQueryDefault,2,2)
instead of
qry_del_test.param1=2 qry_del_test.param2=2 Hexecutequery(qry_del_test)
I'll try as soon as possible.
Thanks for the help |
| |
| |
| | | |
|
| | | | |
| | |
|