Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netezza Sql query

Tags:

sql

netezza

I have a list of tables in a Netezza database and I want to get the name of primary key for each of the tables.

Can anyone provide me the query.

like image 471
Akshay J Avatar asked Sep 15 '10 22:09

Akshay J


2 Answers

You can use this query.

SELECT * FROM _v_relation_keydata;
like image 187
Winder Avatar answered Oct 16 '22 03:10

Winder


There is nothing sort of Primary Key thing in Netezza. If you want to look at the NULL or NOT NULL constraints for your required table you can enter the below commands from your nzsql command line

\d [YOURTABLENAME]

like image 24
Teja Avatar answered Oct 16 '22 02:10

Teja