Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter in tbowse class

Status
Not open for further replies.

LeslieM

Programmer
Jul 4, 2002
9
HU
Hallo, boys!

I've big problem!
I am using the clipper 5.3b compiler, with exospace.
In my program working the tbrowse object, fine.

Every time, when I want to delete one record from the table, after the delete() function, nothing to happen.
How can I set to unvisible this deleted record? Because the simple filter command is very-very slow, in this case.
Has the Clipper 5.3 a special tbrowse function for the filtering? I didn't find! Or other idea?
Somebody can help me?
Thank You, Leslie
(Sorry for my language mistakes)


Leslie M.
 
Hi Leslie

1. In order not to see deleted records, you have to SET DELETE ON. Unlike a filter it applies to all databases in use.

2. After deleing a row in the browse, be sure to refresh the view. Otherwise it will look like the record is still there.

Understand deleted records are still on file until you pack the table. If you don't want to SET DELETE ON you can instead SET FILTER TO .NOT. DELETED(), which will apply to only a single workarea.

Jock
 
Hi Jock!

Thanks for Your help!
But I wrote, the "set filter" command is working fine, just very slow, when the database is big, and it has too much deleted record.

I tried blocking the read function inside the codeblock, when the program step to the deleted record. This procedure skip to the next undeleted rec.
Just this function is not too simple, and it can create more mistake... I want looking for easier and faster way for the online filtering in the codeblock function!
for example here is a sample:
if deleted()
DbSkip(1)
else
DbSkip(0)
endif
It's working, and more faster than "set filter", but sometime, whe I push the PGUP, or PGDWN, the program ignore the deleted record, and read to the table.
I hope, now understable my problem...
Thx a lot, Leslie


Leslie M.
 
Is there any reason not to use the SET DELETE ON command?
If not, just use it and all will be well.

HTH
TonHu
 
Hi TonHu!

Yes, the main reason, why I don't use the "SET DELETED ON" or "SET FILTER TO !DELETED()" command, the speed problem.

Because my programm is running on the Novell Netware Server (ver. 5.1, Pentium 3), with 10-25 active users. Generally, the moving speed int the TBROWSE table quiet good, without filtering. But when I set the DELETE ON, and the number of deleted records growing up, the speed is unusable.
In this case I must use the Pack command, but it needs an exclusive use, and this is not too simple.
I am looking for one special function inside of TBORWSE object, if it possible.
I read already some unpublicated function, just i didn't found this.
Thanx a lot,

Leslie M.
 
If speed and performance are issues:
1. AVOID the SET FILTER function. Everytime it is invoked, it must scan the entire dbf to determine the records to include. The more records added, the slower the process becomes.
2. Use SET DELETED ON. It will make the deleted records 'disappear' without you PACKING the file.



 
Hi, Leslie

OK, now I understand your problem.

How about using a special index for the browsing?

For example, let's say you are browsing the data with an index by a field such as CUST_NO.

You could build a special index for the browsing like:

index on if(deleted(),'1','0')+cust_no to tbrowsendx

Then you would set delete on to make the deleted records invisible.

Then all the non-deleted records would be grouped together by the index, which should eliminate having to skip past all the deleted records and should help your browsing speed, but at the cost of building and maintaining a new index.

Aside from that, I would have a look at your Novell server. If it has enough memory it should be able to cache a good part of the database, and if you are running at least 100megabit networking then 10-15 users is not really very much, assuming they are all locally connected.

Jock
 
Circes9:
Thanks for your reply!
Sure, the "set deleted on" command really faster than "set filter to !deleted()", but the speed also not enough.

Hi Jock!

That's great idea! I don't know, why didn't tried yet?
It's a simple solution! Today I will try it!
Just The index system rebuild is not easy, because a the database always busy.
2. The server is quiet good, with double processors (2*1 GHz IntelPentium3) Intel server motherboard, 512MB High quality RAM, 3xSCSI Drives, etc. The network speed of course 100Mbit, And a server card is using 1Gbit, and connecting to the 1Gbit port of switch.
The number of users more than 30, always, they are using other database programs too. But the server utilization is normal, no overcharged.
So, the database speed is not unusable, just visible the different from the unfiltered mode, and some user (the chiefs) doesn't like that. :)

Lot of thanks for your help:


Leslie M.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top