Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Field Comment in Table Structure
Message
De
02/10/2000 01:03:55
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00423294
Message ID:
00423317
Vues:
13
>Hi All!
>
>I have two DBCs that almost have exactly the same tables in it except for some. I've put some comment in every field of DBC1 and would like to just copy what i've done there in DBC1 to DBC2, most specially the field comment. I've thought about using the AFIELDS() function but it accomodates only the table comment, no field comment. How do I extract the information from the table's field comment, put it, say in an array, and then copy the information from it, and put it in another table..?

Check out DBGETPROP("tablename.fieldname", "Field", "Comment")
and the related DBSETPROP()

You can switch between the DBC's and set it one from the other. e.g.
LOCAL lcDBC, lcField, lcName
OPEN DATA sourcedata
lcDBC = DBC()
lcName= JUSTSTEM(lcDBC)

SELECT d1.objectname AS tname, d2.objectname AS fname, ;
  SPACE(254) AS ccomment ;
  FROM DBC() d1 ;
  JOIN DBC() d2 ;
  ON d1.objectid = d2.parentid ;
  WHERE d1.objecttype = "Table" ;
  AND d2.objecttype= "Field" ;
  INTO CURSOR cuTmp
USE IN (lcName)

USE (DBF("cutmp")) AGAIN IN 0 ALIAS cucomments
SELECT cucomments
REPLACE ccomment WITH ;
  DBGETPROP(FORCEEXT(ALLTRIM(tname),ALLTRIM fname)),"Field", "Comment") ALL

OPEN DATA targetdata
SCAN
  lcField = FORCEEXT(ALLTRIM(tname),ALLTRIM(fname))
  IF INDBC(lcField, "Field")
    DBSETPROP(,"Field","Comment",ALLTRIM(ccomment))
  ENDIF
ENDSCAN
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform