Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL: Passing A FIELD NAME As A Parameter
Message
De
20/04/2000 05:26:33
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SQL: Passing A FIELD NAME As A Parameter
Divers
Thread ID:
00361691
Message ID:
00361691
Vues:
51
Hi All:

I'm trying to create a Stored Procedure where I can send parameters
of which one is a FIELD NAME of a table. Then I'd like to update
that FIELD with another parameter I'm sending (along with the FIELD
NAME) parameter. The code I tried looks like this, but it does not
work.

CREATE PROCEDURE Test_SP
@RoomNo smallint, @Field_Name char, @Assign_This char
AS
UPDATE MyTable
SET @Field_Name = @Assign_This
WHERE ROOM = @RoomNo

@Field_Name is one of the FIELD NAMES in MyTable.

I'm not getting an error message, in fact, the Query Analyzer tells
me that 1 row was affected. When I check the table, no sign of an
UPDATE - nothing's changed.

Any advice would be appreciated. TIA

MAL
Répondre
Fil
Voir

Click here to load this message in the networking platform