From: Dmitry K. <di...@de...> - 2001-03-27 08:24:32
|
Hello, Claudio! "Claudio Valderrama C." wrote: > > I saw this even if udf with param was used in WHERE clause. > > So it should be tested completely. Seems that 4.x and 5.x had better > > behavior than 6.0 in this area. > > Are you suggesting that previous IB versions accepted parameters in UDF > arguments? For me, even in v4, IB always refused to take things like > udf_name(:param) > Or did you succeed previously with such construction in the WHERE clause > with IB5? Sorry, not with 5.x and don't remember about 4.x. I was using udfs with parameters since IB 4.0, but mostly in stored procedures like if ((LAND(:ARR, :ACT) <> 0) or ((:UID = :UI) and (LAND(:URR, :ACT) <> 0)) or ((:GID = :GI) and (LAND(:GRR, :ACT) <> 0))) then CANDO=1; else ... where ACT is input proc variable and URR/GRR are local proc variables (this works for 5.x). So I was wondered that where x = udf(field, :param) does not work in query. I think if it was not supported, it must be :-) It is very strange to support parameters for udf in procedures and do not support them for queries. The only workaround of this problem is to construct query at client side without parameter: .... Q.SQL.Add('select * from table'); Q.SQL.Add('where a = udf(b, '+IntToStr(paramval)+')'); Q.ExecQuery; ... -- Dmitry Kuzmenko, Epsylon Technologies. |