From Newsgroup: comp.databases.ingres
nksvg wrote:
It's when a subselect is happening inside the select clause.
select c_amka_asqenh=m.c_amka,
d_episkep=a.d_episkep,
d_egrafhs=a.d_egrafhs,
eid_epis=0,
c_grnoe_bi_id =
(select squeeze(bi_id) from grnoe
where grnoe.c_grnoe = a.c_grnoe),
c_amka_doctor=p.c_amka,
kat_prog=0,
kleidi=concat(a.c_grnoe, squeeze(varchar(replace(varchar(a.d_episkep),' ',''))))
from epexa a inner join masqe m on
a.am_asqenh = m.am_asqenh
left join mypal p on
a.am_ypal = p.am_ypal
where a.c_grnoe = ? and
a.d_episkep = ? and
a.iatreio = ? and
a.end_yper = ?
The curious thing is that the query runs fine from isql but when
run through a Perl program it throws. The same program and sql query
were running fine before the update to 10.2.0.After the update it
broke. the installation is unpatched so I asked for it to be patched in
hope that this was an Ingres bug.
That subquery needs to be a scalar subquery for the whole thing to be
certain to work. As far as I know Ingres has no way to know
whether it is or it isn't scalar without actually executing it. By
inspection of the syntax it _could_ be scalar so I can't see OPF
ever grumbling about it. If it does turn out not to be scalar you get a different error (E_US1196).
That it works when run in isql makes me think the Perl driver (some kind
of ODBC? or DBD::Ingres?) is garbling something.
(Of course you could just get rid of that subquery, but I'm sure you
know that.)
Roy
--- Synchronet 3.21b-Linux NewsLink 1.2