Re: UNION Error '3078
Posted in 1997
Topics: Connectivity: ODBC / JDBC / .NET, Server Administration
If I'm not mistaken, I hit the 255-char limit on SQL statements with VB3
and SQL Server 4.2 .... not sure if it still exists, you might want to
check it out though.
- Adwait
Oliver Schaudt wrote:
>
> Hello !
>
> We have Visual Basic 5 Enterprise and we try to obtain Data from an Informix
> Database
> with SQL via ODBC.
> We defined the Database objects in VB with DAO, otherwise with RDO and with
> the option 'dbsqlpassthrough' ( but nevertheless MS-Jet takes the control,
> why?).
>
> The definition of the above mentioned VB Database objects are taken out of
> the Microsoft VB examples for RDO and DAO from the help file.
>
> The forthcoming SQL commands in parts (without UNION) will have success,
> but together they won't run.
> The error is not coming without the commands after 'exists'
>
> Here the command:
> SELECT informix_bildinformation.lfd_nr,bildnr,schuhlieferant,schuhlieferbez,
> photolieferant,photolieferbez,easnr,bildformat,abvk_quote,farbe
> FROM informix_bildinformation,informix_abverkaufinfo
> WHERE easnr like '6740*' and informix_bildinformation.lfd_nr =
> informix_abverkaufinfo.lfd_nr and
> informix_abverkaufinfo.abvk_datum =
> (SELECT Max(informix_abverkaufinfo.abvk_datum)
> FROM informix_abverkaufinfo
> WHERE informix_abverkaufinfo.lfd_nr =
> informix_bildinformation.lfd_nr)
> UNION
> (SELECT bi.lfd_nr,bildnr,schuhlieferant,schuhlieferbez,
> photolieferant,photolieferbez,
> easnr,bildformat,0,farbe
> FROM informix_bildinformation bi
> WHERE easnr like '6740*' and not exists
> (SELECT * from informix_abverkaufinfo av where bi.lfd_nr = av.lfd_nr))>
> The complete SQL command runs with 'dbaccess' (INFORMIX-Tool) without an
> error.
>
> Thanks a lot!
> Oliver Schaudt
> o.schaudt@rieker.de
--
Adwait Ullal
adwait@nospam.hotmail.com
(650) 691-5331 (work)