Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Integer constant for SELECT UNION
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Integer constant for SELECT UNION
Divers
Thread ID:
00754666
Message ID:
00754666
Vues:
57
Hi. Sorry this is such a stupid question < g > but I've looked all through VFP help and can't find the answer.

How do you designate an integer constant?!
(Like ldDate = {} or lyMoney = $0).

Why would I want to do this, you ask? I want to create a complicated SQL view by unioning three wildly different tables into a "history" table for customer child records. (Client demanded.)

I want to include Integer PKs from all three tables.

If I do (way simplified):
CREATE SQL VIEW v_AllCustHist AS
SELECT Table1.Field1,
Table1.tb1_pk,
0000000000 AS tb2_pk,
0000000000 AS tb3_pk
FROM Table1 WHERE Table1.cus_fk = ?pnCus_PK
UNION SELECT Table2.Field1,
0000000000 AS tb1_pk,
Table2.tb2_pk,
0000000000 AS tb3_pk
FROM Table2 WHERE Table2.cus_fk = ?pnCus_PK
UNION SELECT Table3.Field1,
0000000000 AS tb1_pk,
0000000000 AS tb2_pk,
Table3.tb3_pk,
FROM Table3 WHERE Table3.cus_fk = ?pnCus_PK

It creates the pk fields for Tables 2 & 3 as N(10). This will be OK as long as the PK never exceeds that large a number, but I obviously don't want to make that limitation. I'm also concerned that, with a large number of records, performance may be degraded by N(10) fields vs. Integer fields.

Do these concerns make sense to you?

TIA,
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform