Selecting a field value is actually what I want to do.  Can I use the EXEC
to do a sub query in a function like that?  What is wrong with using the
EXEC ?

Bernd VanSkiver
[EMAIL PROTECTED]
ColdFusion Developer
----- Original Message -----
From: "Yanik Lupien" <[EMAIL PROTECTED]>
To: "SQL" <[EMAIL PROTECTED]>
Sent: Wednesday, December 05, 2001 9:53 AM
Subject: RE: SQL Query Builder & Date function problem


> Hi!
>
> I only have a small question it is possible to select some field using a
> variable instead of a specific name ?
>
> Some thing like this :
>
> DECLARE @FieldName VARCHAR(25)
> DECLARE @ID INT
>
> SET @FieldName = 'FileName'
> SET @ID = 10
>
> SELECT @FieldName
> FROM TABLENAME
> WHERE ID = @ID
>
> I don't want to use some thing like the command "EXEC ('SQLQUERY')" ...
>
> Thank!
>
> Yanik Lupien
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to