Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create Table Confusion?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00456897
Message ID:
00456921
Vues:
29
>>>
>>>? cTableName                      && Shows PRM1-6A28CBADAB4C11DFFA883999
>>>create table eval(cTableName) ;
>>>( ;
>>>nEmpID 		n(10,0) , ;
>>>cLastname 	c(64) , ;
>>>cFirstName	c(64) , ;
>>>tHireDate	t(8) , ;
>>>cIsTerm		c(32) , ;
>>>cNTName 	c(32) ;
>>>)
>>>
>>>
>>>I made a random table name using a GUID, and am now trying to create a table with that name (I have a DBC created and open).
>>>
>>>I am getting a syntax error whether I use eval or macro substituion or name expression.
>>>
>>>What is the proper way to format this so I always get a random table name?
>>>
>>>Thanks.
>>
>>Take the eval off... you just want
>>
>>create table (cTableName)...
>
>Not sure, you can use "minus" as a legal character in table name. Use underscore instead, e.g.
>
>#DEFINE SYMBOLS "?!+-'%^&~()$"  && Better not use these symbols in TableName
>lcTableName=strtran(chtran(lcTableName,SYMBOLS,replicate("~",12)),"~","")
I tested it, and it works...
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform