# View definition INCORRECT/INVALID

**URL:** <https://forums.toadworld.com/t/view-definition-incorrect-invalid/27281>\
**Category:** Toad Data Point & Toad Intelligence Central\
**Created:** [October 23, 2013, 7:04am UTC](https://forums.toadworld.com/t/view-definition-incorrect-invalid/27281 "2013-10-23T07:04:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikewalters](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@mikewalters](https://forums.toadworld.com/u/mikewalters)\
**Post date:** [October 23, 2013, 7:04am UTC](https://forums.toadworld.com/t/view-definition-incorrect-invalid/27281/1 "2013-10-23T07:04:58Z")

</div>

When trying to display the detailed sql behind a view, TDW only shows the column names and a generic “

” place holder. It does not show the actual SQL that was used to create the view (ie logic used to caculate columns) or any of table(s) that were used in the FROM clause or any kind of WHERE clause. Anyone else experiencing this same thing … the defintiion is incorrect and essentially useless. Example Below

This is occurring in TDP 3.3 – using Netezza

the SQL that I used to create a view…

CREATE OR REPLACE VIEW TEST\_DB…VW\_TEST\_VIEW as  
SELECT WRK1.EFFECTIVE\_YEAR  
, WRK1.SALE\_DATE  
, WRK1.ACCOUNT\_NUM  
, CASE WHEN (((WRK1.EFFECTIVE\_YEAR - PL.CRT\_YEAR) \>= 0) AND ((WRK1.EFFECTIVE\_YEAR - PL.CRT\_YEAR) \<= 2)) THEN 1 ELSE 0 END AS CREATED\_IND  
, CASE WHEN (((WRK1.EFFECTIVE\_YEAR - PL.DLV\_YEAR) \>= 0) AND ((WRK1.EFFECTIVE\_YEAR - PL.DLV\_YEAR) \<= 2)) THEN 1 ELSE 0 END AS DELIVERED\_IND  
FROM  
DB1…PLAN\_DATA PL  
JOIN DB1…PLAN\_ACCOUNT PL\_ACCT  
ON PL.PLAN\_ID\_NUM = PL\_ACCT.PLAN\_ID\_NUM  
JOIN WRK\_DB…PLAN\_SALES\_DATA WRK1  
ON WRK1.ACCOUNT\_NUM = PL\_ACCT.ACCOUNT\_NUM  
AND WRK1.SALE\_DATE \> CASE WHEN PL.PLAN\_DLV\_DTE = ‘1800-01-01’ THEN PL.PLAN\_CRT\_DTE ELSE PL.PLAN\_DLV\_DTE END  
where effective\_year = 2012  
limit 100;

The view definition returned by TOAD:

CREATE VIEW VW\_MFW\_TEST\_VIEW  
AS  
SELECT  
EFFECTIVE\_YEAR  
,SALE\_DATE  
,ACCOUNT\_NUM  
,CREATED\_IND  
,DELIVERED\_IND  
FROM  
\< table\_name\>;

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [October 23, 2013, 8:07pm UTC](https://forums.toadworld.com/t/view-definition-incorrect-invalid/27281/2 "2013-10-23T20:07:49Z")

</div>

What kind of connection are you using? This is how is is for an ODBC connection. But if you are connection to oracle, SQL Server, DB2, mySQL or Sybase, you should not be using ODBC but our native providers. You will get the correct view definition when using one of these native providers
