Subject RE: [firebird-support] Variable column in SELECT.
Author Nick
No you can't. you can do

> declare variable mystr varchar(100);

campo = 'telefono';
mystr = "select " || campo || " from tabla into :valor"
execute mystr

NB syntax not checked but you get the idea, needs firebird 1.5 or higher

--
Nick
-----We Solve your Computer Problems---
UNIX, C, Panther, Ingres, Interbase, Firebird - Available Shortly

> -----Original Message-----
> From: firebird-support@yahoogroups.com
> [mailto:firebird-support@yahoogroups.com] On Behalf Of fsorianop2006
> Sent: 24 June 2006 19:41
> To: firebird-support@yahoogroups.com
> Subject: [firebird-support] Variable column in SELECT.
>
>
> Hi,
>
> Can I use a variable in a SELECT statement in a store procedure?
>
> for example:
>
>
> declare variable campo varchar(20);
> declare variable valor varchar(40);
> begin
> campo = 'telefono';
> select :campo from tabla into :valor;
>
> //expecting to have:
> // select telefono from tabla into :valor;
> end
>
> It is like the macrosubstitution in visual foxpro with the &
> character.
>
> Please let me know,
>
> Fernando Soriano
> soporte@...
>
>
>
>
>
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> --------------------~-->
> Check out the new improvements in Yahoo! Groups email.
> http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/67folB/TM
> --------------------------------------------------------------
> ------~->
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources
> item on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>