Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 6 Jahren, 3 Monaten
Letzter Beitrag:
vor 6 Jahren, 3 Monaten
Beteiligte Autoren:
issah, Al, Droogans.pcs.crosspost

How Do I Create Composite Keys in Code?

Startbeitrag von Droogans.pcs.crosspost am 18.08.2011 15:05

I want to GENERATE a composite key in code as I search through my files in code.

I'm not BUILDING the contents of a composite key, that's simple. I want a brand new one, on the fly, based on two values in the same table that I select. In essence, I want to HReadSeek() on two values without making a composite key in the HFSQL analysis. That way, I can modify the members of a composite key willy-nilly, without creating 2^n additional fields in my tables. That would be ridiculous.

Is this possible? Thanks!



//Syntax: HCreateUK(TableName, NewComposKeyName, Field1, Field2 [, FieldN...])

HReadSeek(TableName, NewComposKeyName, ["FirstName", "LastName"])

//WinDev...What's in store in Ver17?



Message forwarded from pcsoft.us.windev

Antworten:

Hello Droogans

The short answer is you can't create any sort of index on the fly. Windev's index options are quite basic and locked to the structure set up in the analysis. The analysis is a double edged sword in that it forces you to conform to a structure and that allows it to then force the code to match the structure which is extremely beneficial but that inflexibility then rebounds on you when you need to do adhoc searches using ad hoc indexes

I still fondly recall the power and incredible flexibilty of Foxpro indexes - on the fly, partial keys , conditional indexes etc etc - It is sobering to think that a product from the 80's has indexing options and speed that easily surpass a modern products capabilities.

Regards
Al

von Al - am 19.08.2011 00:36
Query the table with the two fields in the where clause.:eek:

Then test the result using hnbrec. Maybe not what you bargained for but it does work and for those of us using native access, thats probably what windev does in the background anyway. @Al, know what you mean, from the Fox universe myself, but we are now in the age of our new masters, SQL .

regards

issah

von issah - am 19.08.2011 13:06
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.