CChalom


Hi,

Is there a modified GENDBC version available that allows the recreation of a DBC keeping the filter expressions from the tables contained

Thanks in advance

Cesar Chalom




Re: GENDBC and Filters

CChalom


I presume that nobody has tried to modify GENDBC...

Is there another good way to store the filter information from the tables of a DBC






Re: GENDBC and Filters

AndyKr

Cesar

I am not sure what you mean...what 'filter' information are you trying to capture here

SET("FILTER") will return the current setting for a filter on the table, I am not sure it is even stored in the DBC....







Re: GENDBC and Filters

CChalom

Hi Andy,

In my Primary Keys (PK) I'm used to add a filter clause "NOT DELETED()".

When I run GENDBC on my Database that has some filters on some PKs, I get the warning:

"Filters no PRIMARY keys are not supported at this time. A comment will be added to your output file specifying the filters"

I see that the latest GENDBC file was created in 1997, and it generates a commented line:

****** These filters need to be added manually ******

* Table Name: TESTE1

* Primary Key: ID

* Filter Expression: .NOT.DELETED()

****************************************************

I'd like to know if someone has modified the GENDBC program in order to generate the tables with the correct filter expressions.

Thanks in advance

Cesar





Re: GENDBC and Filters

AndyKr

I see.

I am sorry I don't think anyone has done this because adding a filter to an index used to mean that it was no longer rushmore optimizable and was generally considered a BAD practice. The only reason I can see for doing this is to re-use PK values, but that is also generally considered bad practice, so I never do that either. Smile

Having said that, index defintions are no stroed in the DBC anyway and are only defined in the Table - you can use SYS(2021) to get the filters valules for a table....Does that do what you want






Re: GENDBC and Filters

CChalom

AndyKr wrote:
Having said that, index defintions are no stroed in the DBC anyway and are only defined in the Table - you can use SYS(2021) to get the filters valules for a table....Does that do what you want

That helps, thanks.

AndyKr wrote:
I am sorry I don't think anyone has done this because adding a filter to an index used to mean that it was no longer rushmore optimizable and was generally considered a BAD practice.

I understand... Strange to say that MSKB some how recommends that... http://support.microsoft.com/default.aspx/kb/139756/en-us

In Fox.Wikis I found that to optimize this filter I should create an index "FOR NOT DELETED()" ... Is that correct

AndyKr wrote:
The only reason I can see for doing this is to re-use PK values, but that is also generally considered bad practice, so I never do that either.

That's exactly my point.

If I understood correctly, the best to do would be to use a PK only for reference, with a Candidate Key to control the data... But can you suggest me a better way to deal with the deleted records

Thanks very much for your answers. My application is getting big, and I'm afraid it's time to review some concepts and reorganize some tables and review some structures and indexes.

Regards

Cesar





Re: GENDBC and Filters

AndyKr

Hi Cesar

>> If I understood correctly, the best to do would be to use a PK only for reference, with a Candidate Key to control the data... But can you suggest me a better way to deal with the deleted records

You are correct. Use system generated values (you can use VFP Auto-incrementing Integer for example) for your primary keys and simply forget about re-using deleted values. Just ignore them until you pack the tables.

If you must have sequential numbers, with no gaps, then as you say, don't use them as Primary Keys! Instead, make them candidate keys (to ensure uniqueness) and use a custom function to track and generate the values only when you actually save a record.

Deleted records are not really an issue unless you try to re-use keys that should be unique.






Re: GENDBC and Filters

CChalom

Thanks very much !

I've just checked it here, and GENDBC works pretty nice generating code for the Candidate Indexes. So, I'll add some AutoInc fields for the PK's

Regards

Cesar