Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Comparing
Message
From
31/07/2001 07:46:55
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
31/07/2001 07:29:44
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00537681
Message ID:
00537685
Views:
23
>Can anyone tell me how i can programmatically compare two table structures to ensure that they are the exact same...?

A way is :
Select 0
Use Table1
Copy struc extended to T1
Use T1
Scatter fields 	;
  Table_Rule, Table_err, Table_name, ;
  Ins_Trig, Upd_Trig, del_trig, Table_cmt ;
  name lo1 memo
Select 0
Use Table2
Copy struc extended to T2
Use T2
Scatter fields 	;
  Table_Rule, Table_err, Table_name, ;
  Ins_Trig, Upd_Trig, del_trig, Table_cmt ;
  name lo2 memo
llTablePropsDifferent = !compobj(lo1,lo2)
Select T1
Scan
  Scatter fields ;
    FIELD_NAME, FIELD_TYPE, FIELD_LEN,  FIELD_DEC,;
    FIELD_NULL, FIELD_NOCP, FIELD_DEFA, FIELD_RULE, FIELD_ERR ;
    name loT1 memo
  Select T2
  Locate for FIELD_NAME == loT1.FIELD_NAME
  Scatter fields ;
    FIELD_NAME, FIELD_TYPE, FIELD_LEN,  FIELD_DEC,;
    FIELD_NULL, FIELD_NOCP, FIELD_DEFA, FIELD_RULE, FIELD_ERR ;
    name loT2 memo
  llDifferent = !compobj(loT1,loT2)
  If llDifferent
    Exit
  Endif
  Select T1
Endscan
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform