Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create a Table programmatically
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Create a Table programmatically
Divers
Thread ID:
00562933
Message ID:
00562933
Vues:
68
Please help:
I'm trying to create a universal data import table based upon the content of another table I call 'schema'. Schema contains the field names, length, type and start and end points of the fields to be imported from a ASCII file. I'm hung up on creating the new data table using just variables to declare the fields. Here is my latest version of code, and it keeps erroring out on the "Alter Table" command.

I really appreciate your help.

Bob Ohrstedt
RJO Associates

LOCAL lcfile, lcalias, lcreclen, lafields

IF NOT USED('schema')
USE schema IN 0 SHARED
ENDIF

CREATE TABLE OhioStreets(fieldnum I(4))

IF NOT used('OhioStreets')
USE OhioStreets IN 0 EXCLUSIVE
ENDIF
SELECT schema

GO top


lcfields = ""
SELECT schema
SCAN

lcFieldName = schema.desc
lnLength = schema.length
lctype = schema.type

ALTER TABLE add column &lcfieldname &lctype(lnlength)

LOOP
EXIT
ENDSCAN
Robert J. Ohrstedt
RJO Associates
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform