Jan-05-2018, 12:22 PM
Hello friends,
I'm trying to fetch all view defintions defined in a database using Python
query="SELECT DEFINITION FROM DATABSE1.._V_VIEW WHERE database='DATABASE1' and VIEWNAME in ('VIEW1','VIEW2')"
cur.execute(query)
defintion=cur.fetchall()
print (defintion)
I'm getting below result :
[('Not a view', ), ('SELECT * FROM TABLE1)]
If I use the same query in database I get two SQL queries. Do not know why Python returns 'Not a view' result for some views.
The Database is Netezza.
Value in DEFINITION column is very huge 4000-5000 characters, it's the view definition.
Has anyone faced similar issue before? Look forward to hearing your responses :)
Thanks,
Leo
I'm trying to fetch all view defintions defined in a database using Python
query="SELECT DEFINITION FROM DATABSE1.._V_VIEW WHERE database='DATABASE1' and VIEWNAME in ('VIEW1','VIEW2')"
cur.execute(query)
defintion=cur.fetchall()
print (defintion)
I'm getting below result :
[('Not a view', ), ('SELECT * FROM TABLE1)]
If I use the same query in database I get two SQL queries. Do not know why Python returns 'Not a view' result for some views.
The Database is Netezza.
Value in DEFINITION column is very huge 4000-5000 characters, it's the view definition.
Has anyone faced similar issue before? Look forward to hearing your responses :)
Thanks,
Leo