Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL: Passing A FIELD NAME As A Parameter
Message
From
20/04/2000 05:26:33
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SQL: Passing A FIELD NAME As A Parameter
Miscellaneous
Thread ID:
00361691
Message ID:
00361691
Views:
52
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
Reply
Map
View

Click here to load this message in the networking platform