Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLEXEX() to call SQL Server stroed procedure
Message
De
24/03/2003 19:16:11
 
 
À
24/03/2003 17:51:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00769509
Message ID:
00769536
Vues:
17
Here is my two cents for dropping and adding columns.
*!* -----------------------------------------------------------------
*!* ADD a new column to the Northwind customers table
*!* ADD doesn't understand the keyword COLUMN
*!* -----------------------------------------------------------------
function addcolumn
  with this
    .lccommand = "ALTER TABLE customers ADD Junk2 varchar(20)"
    .lncompleted = sqlexec(.lnhandle,.lccommand)
    .lcfunction = "Add a column"
    .lcreturn =  iif(.lncompleted>0,.lcfunction,"Error when attempting to: "+.lcfunction)
  endwith

*!* -----------------------------------------------------------------	
*!* Drop that column from the Northwind customers table
*!* DROP requires the key word COLUMN
*!* ----------------------------------------------------------------- 
function dropcolumn
  with this
    .lccommand = "ALTER TABLE customers DROP COLUMN Junk2"
    .lncompleted = sqlexec(.lnhandle,.lccommand)
    .lcfunction  = "Drop a column"
    .lcreturn =  iif(.lncompleted>0,.lcfunction,"Error when attempting to: "+.lcfunction)
  endwith
Carole Shaw
Fred Hutchinson Cancer Research Center

Eagles may soar, but weasels don't get sucked into jet engines.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform