Oppolzer - Informatik / Blog


Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie

DB2-L - SQL-Validierung auf merkwürdige (und aufwendige) Art

Subject:

Re: Why is DB2 trying to satisfy this query?

From:

Bernd Oppolzer <bernd.oppolzer@T-ONLINE.DE>

Reply-To:

DB2 List <db2-l@lists.idug.org>

Date:

2002.11.23 13:27:00


I fully agree. The vendor should change its software, since PREPARE is the
normal feature to do this, not only on DB2, but also on other DBMSes as well.

Regards

Bernd


Am Sam, 23 Nov 2002 schrieben Sie:
> S.,
>
> While 0=1 is a (semi)legitimate (not best!) way of influencing the
> optimizer, the usage you describe sounds really strange. Why not just a
> PREPARE? If sqlcode = 0, it's valid else not.
>
> Why blame DB2? This seems like a shortcoming not of DB2 but of the vendor
> product. If DB2L protocol permits it, what product and vendor, please?
>
> HTH
>
> Suresh
>
>
>
>
> >
> >
> > Why is DB2 trying to satisfy this query?
> > November 22, 2002 08:58 PM
> > We have a product that has a strange way of syntax checking it's SQL. It
> > sends the SQL across with a predicate of "where 0=1 and ...". If the query
> > comes back with a not found condition, it knows the syntax is good.
> >
> > What we're seeing is that DB2 spends a lot of time trying to resolve the
> > rest of the where condition. It seems to me that it should be smart enough
> > to know that it can never satisfy the "0=1" condition and not try to find
> > the rest. If that were the case, we wouldn't have a problem.
> >
> > Any thoughts or comments?
> >
> > S.
> >

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie