[Ticket #237] [firebird-support] Re: selecting a field by name (using a var)

2014-03-07 Thread Desarrollo
This is a notification from the Help Desk.




On Mar 07, 2014 @ 03:29 pm, shg_siste...@yahoo.com.ar wrote:
Hi Karol! Sorry bat I don't know how to do it with a normal select... 
how would it be?
-s


[Non-text portions of this message have been removed]

--
This is an automated response.  Your issue has been noted.  We'll be in touch 
soon.



Please reply to this email or visit the URL below with any additional details.

http://DANTOIN:9675/portal/view-help-request/237




[Non-text portions of this message have been removed]



[firebird-support] Re: selecting a field by name (using a var)

2011-11-07 Thread Sergio
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



[firebird-support] Re: selecting a field by name (using a var)

2011-11-07 Thread Sergio
Thank you very much Tomasz  Frank!

I'm selecting by the PK, so I'm prety sure that there always will be just one 
row!! 

As allways, the help I receive from this group in invaluable to me!!

-s



Re: [firebird-support] Re: selecting a field by name (using a var)

2011-11-07 Thread Frank Schlottmann-Gödde
Am 07.11.2011 16:27, schrieb Tomasz Tyrakowski:
 Hi,
 
 One small improvement.
 
 Instead of
 
 execute statement :loc_sql into :out_fecha;
 
 I'd recommend
 
 for execute statement :loc_sql into :out_fecha do suspend;
and additional take a look at
http://www.firebirdsql.org/file/documentation/release_notes/html/rlsnotes251.html#rnfb25-psql-dynex


hth

Frank