Help! View not working properly!
Posted in 1999
Topics: Connectivity: ODBC / JDBC / .NET
Hi,
The following sql works fine on one database, but falls over on another
database. The key thing is the field vderived1.
The first statement evaluates a derived field into the temporary view. The
second statement runs a check to see if the evaluated derived field is not
null. On our version of the clients database this works fine. But on their
supposedly identical database, the second query falls over saying that it
can only be performed on simple columns. The odbc drivers we use are the
same.
This has to be some sort of configuration issue with the database which
makes the view operate in a different way.
If anyone can shed some light on this, I would be very gratefull
Thanks
H
/* Create Temp Derived Field View */
Create View ISMTDVCOOPE_H1(account_id, vderived1) as select account_id,
(TODAY - dt_subs_opened) from rmtadmin.mdm_subscripnquick
/* Create Holding View */
CREATE VIEW coope_h.HLD430QV(customer_id) AS SELECT customer_id FROMrmtadmin.mdm_customerquick A WHERE 0 = (SELECT COUNT(*) FROM
rmtadmin.mdm_accountquick D, ISMTDVCOOPE_H1 E WHERE E.account_id =
D.account_id AND D.customer_id = A.customer_id AND NOT ( VDERIVED1 >= 14
AND VDERIVED1 IS NOT NULL)) AND 1 <= (SELECT COUNT(*) FROM
rmtadmin.mdm_accountquick D, ISMTDVCOOPE_H1 E WHERE E.account_id =
D.account_id AND D.customer_id = A.customer_id)