Subject | Re: selecting a field by name (using a var) |
---|---|
Author | Sergio |
Post date | 2011-11-07T14:04:02Z |
well... after doing my post I've found this..
http://www.firebirdfaq.org/faq322/
and I did this
CREATE PROCEDURE PANIO_TERMINADO (
in_id fk_id,
in_etapa codigo)
returns (
out_fecha fecha_hora)
as
declare variable loc_sql descripcion;
begin
loc_sql = 'select ' || in_etapa || ' from pedidos_control where id = ' || cast( :in_id as varchar(10));
execute statement :loc_sql into :out_fecha;
suspend;
end
It's OK? or it can be improved? Thanks again!!!!
-sergio
http://www.firebirdfaq.org/faq322/
and I did this
CREATE PROCEDURE PANIO_TERMINADO (
in_id fk_id,
in_etapa codigo)
returns (
out_fecha fecha_hora)
as
declare variable loc_sql descripcion;
begin
loc_sql = 'select ' || in_etapa || ' from pedidos_control where id = ' || cast( :in_id as varchar(10));
execute statement :loc_sql into :out_fecha;
suspend;
end
It's OK? or it can be improved? Thanks again!!!!
-sergio