This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
admin:features:attach:tables [2012/02/29 21:47] doc |
admin:features:attach:tables [2016/06/28 22:38] (current) |
||
|---|---|---|---|
| Line 30: | Line 30: | ||
| - | Attaching a table is simple, and uses syntax that is nearly identical to CREATE TABLE, as shown below: | + | Attaching a table is simple, and uses the [[dev:sql:statements:attach_table:home|ATTACH TABLE]] statement. The ATTACH TABLE syntax is nearly identical to CREATE TABLE, as shown below: |
| <code> | <code> | ||
| - | attach table "GEO"."AREACODES" | + | > connect to simple |
| - | physical "dat/arc.dat" | + | Connected to D:\class\labs\attach\simple.xml |
| - | ( | + | |
| - | "AREACODE" character(3), | + | > attach table "AREACODES" |
| - | "TYPE" string(7), | + | >> physical "dat/arc.dat" |
| - | "TYPE_DESC" string(31), | + | >> ( |
| - | "ASSIGNABLE" character(1), | + | >> "AREACODE" character(3), |
| - | "EXPLANATION" string(31), | + | >> "TYPE" string(7), |
| - | "RESERVED" character(1), | + | >> "TYPE_DESC" string(31), |
| - | "ASSIGNED" character(1), | + | >> "ASSIGNABLE" character(1), |
| - | "ASSIGN_DATE" ascii date, | + | >> "EXPLANATION" string(31), |
| - | "GEOGRAPHIC" character(1), | + | >> "RESERVED" character(1), |
| - | "SERVICE" string(39), | + | >> "ASSIGNED" character(1), |
| - | "STATES" character(10), | + | >> "ASSIGN_DATE" ascii date, |
| - | "LOCATION" string(31), | + | >> "GEOGRAPHIC" character(1), |
| - | "COUNTRY" character(2), | + | >> "SERVICE" string(39), |
| - | "AREA_SERVED" string(511), | + | >> "STATES" character(10), |
| - | "IN_SERVICE" character(1), | + | >> "LOCATION" string(31), |
| - | "IN_SERVICE_DATE" ascii date, | + | >> "COUNTRY" character(2), |
| - | "OVERLAY" character(1), | + | >> "AREA_SERVED" string(511), |
| - | "OVERLAY_COMPLEX" character(20), | + | >> "IN_SERVICE" character(1), |
| - | "PARENT" character(32), | + | >> "IN_SERVICE_DATE" ascii date, |
| - | "TIME_ZONE1" character(1), | + | >> "OVERLAY" character(1), |
| - | "TIME_ZONE2" character(1), | + | >> "OVERLAY_COMPLEX" character(20), |
| - | constraint AREACODES_AREACODE_PK primary ("AREACODE") | + | >> "PARENT" character(32), |
| - | ); | + | >> "TIME_ZONE1" character(1), |
| + | >> "TIME_ZONE2" character(1), | ||
| + | >> constraint AREACODES_AREACODE_PK primary ("AREACODE") | ||
| + | >> ); | ||
| + | Table AREACODES attached | ||
| + | </code> | ||
| + | |||
| + | The newly attached tables can be seen using the SHOW TABLES command in OdxSQL: | ||
| + | |||
| + | <code> | ||
| + | > show tables | ||
| + | |||
| + | Tables | ||
| + | ------ | ||
| + | |||
| + | Environment | ||
| + | Database | ||
| + | Table Length Cols Rows Type | ||
| + | ---------------------------------------------------------------------------- | ||
| + | USER_ENVIRONMENT | ||
| + | SIMPLE | ||
| + | COUNTRIES 98 7 239 FIXED | ||
| + | STATES 44 6 76 FIXED | ||
| + | GENDERS 33 2 2 FIXED | ||
| + | HOUSEHOLDS 99 6 1,909 FIXED | ||
| + | INDIVIDUALS 159 7 5,000 FIXED | ||
| + | $TEMPDB | ||
| + | *AREACODES 747 21 800 FIXED | ||
| </code> | </code> | ||