Focal Point
[CLOSED] Maintain delete

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5471040671

July 12, 2006, 03:42 PM
Ron R
[CLOSED] Maintain delete
We have a focus database with the following layout:
FILE=RFAVORITE ,SUFFIX=FOC
SEGNAME=SEG01 ,SEGTYPE=S02
FIELDNAME =CLIENT , E01 , A10 , FIELDTYPE=I, $
FIELDNAME =TAG , E02 , A20 , FIELDTYPE=I, $
FIELDNAME =DUMMY , E03 , A1 , , $

I would like to be able to delete all rows where CLIENT equals a certain constant. e.g. where client eq 'SMITH'.

Is there a way to accomplish this using Maintain.

Thanks,
Ron Richards

This message has been edited. Last edited by: Kerry,
July 12, 2006, 03:48 PM
Mikel
Example:

MAINTAIN FILE RFAVORITE
  -* Read records to delete into stack.
  FOR ALL NEXT CLIENT INTO STK WHERE CLIENT EQ 'SMITH' ;
  TYPE "<STK.FOCCOUNT  rows to delete "

  -* Delete all records from stack.
  FOR ALL DELETE CLIENT FROM STK ;
  TYPE "ERROR: <FOCERROR "
END

Regards,
Mikel


WebFOCUS 8.1.05, 8.2.01
July 12, 2006, 03:58 PM
Leah
Don't use maintain, however, do you want only SMITH or any name that has SMITH in it? If the latter then rather than EQ you could use CONTAINS if maintain works the save for selection.


Leah
July 12, 2006, 04:01 PM
Ron R
Thanks Mikel, this worked great.

Ron
October 31, 2012, 06:01 PM
BJK
[SOLVED] This was a key issue......I am new to Maintain. I have a oracle table with column one being the same name and the second column is different. How do i delete an entry for the second column only? When I try it with the following code It ends up deleting all entries that have the same column one.


FOR ALL NEXT FIRSTLIST.GROUPNAME1 FIRSTLIST.CUST1 INTO STK WHERE
(firstlist.FIRSTLIST.GROUPNAME1 EQ zGROUPNAME1 AND
firstlist.FIRSTLIST.CUST1 EQ zCUST1);
TYPE "

-* Delete records from stack.
DELETE FIRSTLIST.CUST1 FROM STK;

help would be appreciated thanks

This message has been edited. Last edited by: BJK,


Product WF 7.1.6 Windows
Database Oracle
outputs PDF, HTML, EXCEL
October 31, 2012, 06:39 PM
BJK
MISSED THE DELETE STATEMENT
Here it is

-* Delete all records from stack.
DELETE FIRSTLIST.GROUPNAME1 FIRSTLIST.CUST1 FROM STK;


Product WF 7.1.6 Windows
Database Oracle
outputs PDF, HTML, EXCEL