Focal Point
[CLOSED] Deleting Rows from an .ftm

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

July 29, 2014, 11:30 AM
J.Biza
[CLOSED] Deleting Rows from an .ftm
I am trying to delete a number of records from an .ftm I’ve created based on a value in an individual field. My .mas is a FIX so there is no key associated with. I’ve tried SQL to delete these rows:
SQL
DELETE FROM [file] WHERE [field] = ‘_’ ;
END
I’ve heard about the MODIFY function to do this, but I don’t understand it and can’t get it to work, however I’d prefer to use SQL since that is how row are being entered with INSERT. Any suggestions would be appreciated.

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7703
July 29, 2014, 05:34 PM
Waz
flat files cannot have records removed via SQL or MODIFY.

The best way would be to TABLE the file and filter the records into a new file.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

July 30, 2014, 03:58 AM
Ram Prasad E
You could try with OS Language(Batch for windows or Shell for Unix).


Thanks,
Ram


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
July 30, 2014, 04:04 AM
Dave
Listen to Waz...

TABLE FILE whatever_ftm
PRINT fields
WHERE field NE '_'
ON TABLE HOLD AS whatever_ftm
END


Only I would put the records directly back in the same ftm.

G'luck


_____________________
WF: 8.0.0.9 > going 8.2.0.5
August 05, 2014, 12:01 PM
J.Biza
I was able to modify the file using TABLE file, but the data that still existed in the file was was changed because the data in the file was not formatted correctly. Do I need a ON TABLE HOLD AS whatever_ftm FORMAT some_format to keep the same formatting for the file?


WebFOCUS 7703
August 05, 2014, 05:58 PM
Waz
Whats the format of the file ?

Can you give an example ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

August 06, 2014, 09:13 AM
J.Biza
I hope this is providing the info you need. Here is the .mas.

FILENAME=tk_comm_log_prod, SUFFIX=FIX , $
SEGMENT=SEG01, SEGTYPE=S0, $
FIELDNAME=TK_INIT, ALIAS=E01, USAGE=A3, ACTUAL=A3,
MISSING=ON, $
FIELDNAME=DATE_ENT, ALIAS=E02, USAGE=YYMD, ACTUAL=DATE,
MISSING=ON, $
FIELDNAME=TIME_ENT, ALIAS=E03, USAGE=A5, ACTUAL=A5,
MISSING=ON, $
FIELDNAME=COM_CHAN, ALIAS=E04, USAGE=A15, ACTUAL=A15,
MISSING=ON, $
FIELDNAME=REASON, ALIAS=E05, USAGE=A30, ACTUAL=A30,
MISSING=ON, $
FIELDNAME=EMPL_ID, ALIAS=E06, USAGE=A7, ACTUAL=A7,
MISSING=ON, $
FIELDNAME=NOTE, ALIAS=E07, USAGE=A1000, ACTUAL=A1000,
MISSING=ON, $
FIELDNAME=TIMESTAMP, ALIAS=E08, USAGE=A19, ACTUAL=A19,
MISSING=ON, $

When I created a hold file with a filter in the where clause, it saved the data in a weird format (appears like DB language).

Let me know if you need more info. I'm not too good when it comes to the technical terminology.


WebFOCUS 7703
August 06, 2014, 05:31 PM
Waz
Does your code have ON TABLE HOLD AS {} only ?

If so, and dates and numerics will be binary.

If you add FORMAT ALPHA, the values will be readable.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code