cherokee
12th July 2005, 20:49
Hello everyone,

I am deleting some records from a table that I generate when a session starts, after user finishes, the records that were not updated by the user, I am deleting them. I want the session finishes without asking "Delete Records Yes/NO". It will always be yes!.

Thanks in advance,

Carlos

NPRao
12th July 2005, 22:03
I am deleting them.
The Q is how are you deleting them ?

If you mark and press X the Q will popup. You can either code it after.program section() or choice.end.program() or choice.abort.program() sections.

You can also mark and delete and avoid the standard option to pop the Q using this example code -

choice.mark.delete:
before.choice:
for counter = 1 to filled.occ
if mark.table(counter) then
select zmmig212.*
from zmmig212 for update
where zmmig212.spno = :zmmig212.spno
and zmmig212.stat = zmmig.tsst.new
as set with 1 rows
selectdo
db.delete(tzmmig212, db.retry)
commit.transaction()
endselect
endif
endfor
refresh.all.occs()
choice.again()

cherokee
12th July 2005, 22:44
NPRao,

I am deleting them this way...


choice.end.program:
before.choice:
do.all.occ(find.not.entered.lots)
execute(mark.delete)


function find.not.entered.lots()
{
if isspace(tssma104.cser) and tssma104.sdat = date.num() then
mark.occ(actual.occ)
endif
}




Carlos

loveneesh
13th July 2005, 07:28
You can directaly delete record from table as given bellow
choice.end.program:
before.choice:
current.date = date.num()
cser = ""
|variable cser should have the same domain used for field tssma104.cser
select tssma104.*
from tssma104 for update
where tssma104.cser = :cser
and tssam104.sdat = :current.date
selectdo
db.delete(ttssma104,db.retry)
commit.transaction()
endselect

cherokee
20th July 2005, 20:52
Thanks I am deleteing them with db.delete(<table>,...) directly.

Appreciated.

Carlos

mraguthu
10th February 2006, 01:02
I am not programmer...

I have list of BPs & departments..need to be deleted from "tccom112" table. I tried through exchange program, but no luck. Can any one have idea to do this stuff?

Basically I have file..that contains "BP|Department"...based on that criteria, the whole record need to be deleted.

Any feedback appreciate.
Thanks,
Mur

Francesco
10th February 2006, 01:26
Delete Mark? But Mark is doing such a wonderful job on this board. Why would you want to do that?


sorry....couldn't resist.

mark_h
10th February 2006, 15:36
A little humor never hurts. :)

The only way I ever got a delete exchange to work was to set the exchange scheme to use indicators. Then I added "d|" at the beggining of all the lines. This seemed to work, but it has been a long time since I used delete this way. Now I usually write a program to read the file, find the record and delete it.

Rita Kotecha
13th February 2006, 09:30
Hi Charlos,

See if this helps us meet the purpose

string main.table$(9) 4R Name of current main table.

long mark.table() 4R

This array indicates which records are marked. The size of this array is set to fattr.occurnr. For example, if records 3 and 8 are marked, then:

mark.table(3) = 1
mark.table(8) = 1

and other elements in the array are 0 (false).