473,385 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to find the primary key of a particular table?

hi,

i am working on db2.
how can i check for a particular table,the primary key of that table.
for eg. in table REGISTRATION their are around 20 columns. how to check which is the primary key of that table
Feb 1 '11 #1

✓ answered by deepak n

Try the following query

SELECT sc.name
FROM SYSIBM.SYSCOLUMNS SC
WHERE SC.TBNAME = 'REGISTRATION'
AND sc.identity ='N'
AND sc.tbcreator=schemaname
AND sc.keyseq=1

2 19859
Try the following query

SELECT sc.name
FROM SYSIBM.SYSCOLUMNS SC
WHERE SC.TBNAME = 'REGISTRATION'
AND sc.identity ='N'
AND sc.tbcreator=schemaname
AND sc.keyseq=1
Feb 1 '11 #2
It worked.

Thank you deepak
Feb 1 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: mike | last post by:
regards: Where to find tag mapping-table of HTML translated to XHTML1.0 Any positive suggestion is welcome. thank you May goodness be with you all
0
by: Justin Tocci | last post by:
I've found the pg_depend table, but it doesn't appear to include this info. (Or am I missing it?) I'm looking to get all view names that I need to drop to allow a particular table to DROP...
1
by: JJ | last post by:
Hi, Ok using Typed Datasets and using a table in that dataset that I am working on. What do I use in order to find a particular row and be able to update db with row changes? Do I use a...
3
by: bikkaran | last post by:
how to find the base table of an ALIAS ? thanks
26
rsrinivasan
by: rsrinivasan | last post by:
Hi, 1. I have some table. But i do not know how to find primary key column, forign key column in that table. Is any procedure or function is available in oracle to find this?. Thanks,...
1
by: sandeep banerjee | last post by:
suppose i have got a project which uses 100 forms .there is a particular table say t_1 which is used in many forms .I want to make change in the code where ever the table t_1 ...
1
by: judy | last post by:
I have several databases that are used to collect data for different client-projects. My intention was to collect the data, and administer mySQL so each client could see only their data. Each of...
6
by: warpcon | last post by:
Im trying to build a database starting with one of the templates that come with access. I took out the employee part in all the tables and forms. Now when I pull up a workorder and then try to view...
1
by: alex250374 | last post by:
Hello to all, are not practical and db2... I need urgent help: how can count the number of select is done on a particular table in a certain period of time?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.