Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Incorporate a parameter into a script
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01676759
Message ID:
01676764
Vues:
43
J'aime (1)
if you do Textmerge you need to realize that the string is parsed literally. Therefore the correct usage of inline Textmerge would be:
ALTER TABLE <<tcTableName>> ALTER COLUMN <<tcFieldName>> varchar(max) <<iif(tlNull, 'NOT NULL', 'NULL')>>
>UPDATE. Found solution. Simply store the value into a variable.
>
>cNullValue = 'NOT NULL'
>ALTER TABLE <<tcTableName>> ALTER COLUMN <<tcFieldName>> varchar(max) <<cNullValue>>
>
>Works.
>
>Hi,
>
>I created a procedure in my VFP 9 program that changes the column of the SQL Server DB from Text to Varchar(max) (Thanks to Borislav Borissov!). It works.
>I am trying to make this procedure more generic so that it receives a parameter indicating if the column should allow NULL or not.
>Instead of writing two scripts, I would like to incorporate the passed parameter into the VFP code. Here is the snippet of the code:
>
>lparameter tlNull   && .F. to not to allow null.  .T. to allow NULL
>ALTER TABLE <<tcTableName>> ALTER COLUMN <<tcFieldName>> varchar(max) NOT NULL
>
>The code above is for NOT NULL only. How do I change the NOT NULL to use the Parameter tlNull?
>
>This is what I tried:
>
>ALTER TABLE <<tcTableName>> ALTER COLUMN <<tcFieldName>> varchar(max) <<iif(tlNull, NOT NULL, NULL)>>
>
>
>But the above produces NULL with two periods, one before and one after. Why?
>
>TIA
Christian Isberner
Software Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform