PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WEBDEV 2024 → TableDelete Not Working
TableDelete Not Working
Started by Zach, Jun., 19 2013 2:54 PM - 4 replies
Posted on June, 19 2013 - 2:54 PM
Here is my code run in WebDev Server with AJAX on:

row is int = TableSelect(Table)
TableDelete(Table, row)

IF Table..Occurence = 0 THEN
modify record
END


I've also tried and used before
TableDelete(Table, Table)

I've tried it with the table using direct access and loaded in memory
Posted on June, 19 2013 - 4:26 PM
I just use TABLEDELETE(Table) and works just fine

Sometimes I have to do a refresh so i do a:

TableDelete(Table)
TableDisplay(Table,taStart)
Posted on June, 19 2013 - 4:47 PM
Hi Zach

where is this code?
What type of table?
What does "not working" means?

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

New web site (EXPERIMENTAL) http://www.fabriceharari.eu
(More information on http://www.fabriceharari.com)


On 6/19/2013 6:54 AM, Zach wrote:
Here is my code run in WebDev Server with AJAX on:

row is int = TableSelect(Table)
TableDelete(Table, row)

IF Table..Occurence = 0 THEN
modify record
END


I've also tried and used before
TableDelete(Table, Table)

I've tried it with the table using direct access and loaded in memory
Posted on June, 21 2013 - 2:15 PM
I'm using TableDisplay(Table, Table) to refresh which refreshes the table with the selected row on the same index.
This code is on a button click server code running AJAX mode.
It is a memory table.
not working means it does not delete anything. The TableDisplay refreshes the table but the TableDelete right before it does not delete.

I fixed the issue by running a simple HExecuteSQLQuery statement.
Which is more efficient? HExecuteSQLQuery or TableDelete?
Posted on June, 22 2013 - 5:32 PM
Hi Zach

HExecuteSQLQuery is doing some work on the files of the DB
TableDelete is deleting a ROW in a control table, ie NOT in the DB,
except if the table is LINKED to a file or query.

so they are definitely not doing the same thing, which is why I was
asking what type of table we are talking about...

With the limited set of information I have, I am guessing that your
table is filled by programming, with data coming from a query...

When you are doing a tableDelete, you ARE deleting a row in the table,
but neither in the file nor in the query...

So your table display is REdisplaying the deleted row from the the
original data source...

When yo are doing the query to delete the line in the FILE, the
tabledisplay displays the content of the file and therefore the line is
question disappears

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

New web site (EXPERIMENTAL) http://www.fabriceharari.eu
(More information on http://www.fabriceharari.com)



On 6/21/2013 6:15 AM, Zach wrote:
I'm using TableDisplay(Table, Table) to refresh which refreshes the
table with the selected row on the same index.
This code is on a button click server code running AJAX mode.
It is a memory table.
not working means it does not delete anything. The TableDisplay
refreshes the table but the TableDelete right before it does not delete.

I fixed the issue by running a simple HExecuteSQLQuery statement.
Which is more efficient? HExecuteSQLQuery or TableDelete?