• Re: [Info-ingres] E_OP068C A bad select (or subselect) target list has been found

    From nksvg@nksvg1@gmail.com to comp.databases.ingres on Tue Mar 2 13:21:36 2021
    From Newsgroup: comp.databases.ingres


    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.
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Paul White@paul.white@shift7solutions.com.au to nksvg on Wed Mar 3 08:17:18 2021
    From Newsgroup: comp.databases.ingres

    For sure, make sure the installation is patched up. (just like you would advise to keep Microsoft patches up to date).-a Confirm the Ingres client
    side is running recent release.

    For your info:

    Version 10.2.0: released Feb 2015.
    Patch P15014: released Jun 2016 has 345 bug fixes, 30 of them mention
    subquery or subselect.



    On 3/03/2021 7:21 am, 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.
    _______________________________________________
    Info-ingres mailing list
    Info-ingres@lists.planetingres.org https://lists.planetingres.org/mailman/listinfo/info-ingres
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From nksvg@nksvg1@gmail.com to comp.databases.ingres on Tue Mar 2 14:26:38 2021
    From Newsgroup: comp.databases.ingres

    Thanks Paul,
    this info will come handy!
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Roy Hann@specially@processed.almost.meat to comp.databases.ingres on Wed Mar 3 18:01:19 2021
    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