Hi
In an importroutine I import records in a table and at the end I do an updateTable(). I loop through a file and insert a record in the table for each filerow. If a record is not valid I want to delete it (so that it is not imported). Because the record is inserted it has now rownumber so how do I use xxx.deleteRow(?) ? Or is there another way?
Regards, Harry
delete inserted row
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 118
- Joined: Tue Oct 23, 2012 7:01 am
- Location: The Netherlands
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Harry,
All rows have a row number - it's assigned by the system when the row is inserted.
There are two ways to delete a row, with and without a row number i.e.
The first one deletes the table's "current row". A row is the current row when you insert it or when you loop through the rows e.g. you can do this:
or you can do this:
To delete using a row number, you would normally find the row first e.g.
Regards
Jon
All rows have a row number - it's assigned by the system when the row is inserted.
There are two ways to delete a row, with and without a row number i.e.
Code: Select all
tab.deleteRow();
tab.deleteRow(25);
Code: Select all
tab.insertRow();
tab.deleteRow(); // deletes the row just inserted
Code: Select all
var rows = tab.rows;
while (rows.next())
{
if ...
tab.deleteRow();
}
Code: Select all
var row = tab.findRow(tab.COL1, "value");
if (row != -1)
tab.deleteRow(row);
Jon
0 x
Who is online
Users browsing this forum: No registered users and 25 guests