Connecting Tech Pros Worldwide Forums | Help | Site Map

how to make a column at column no X, a primary key

Prabodh
Guest
 
Posts: n/a
#1: Jul 19 '05
Hi All,

Do u know how to make 22nd column a primary key if there is a table of
100 columns and you don't know the names of the columns?

If u do know plz reply ASAP…

Prabodh

Douglas Hawthorne
Guest
 
Posts: n/a
#2: Jul 19 '05

re: how to make a column at column no X, a primary key


"Prabodh" <prabodh_kelkar@rediffmail.com> wrote in message
news:c595dbe9.0406220037.36f00311@posting.google.c om...[color=blue]
> Hi All,
>
> Do u know how to make 22nd column a primary key if there is a table of
> 100 columns and you don't know the names of the columns?
>
> If u do know plz reply ASAP.
>
> Prabodh[/color]

Pradodh,

The DESCRIBE command in SQL*Plus tells you the names of the columns for a
table.

You can also use the data dictionary view, USER_TAB_COLUMNS, to find the
name of the 22nd column of a table. Use the COLUMN_ID column of that view
to find the order that the column was created in.

Douglas Hawthorne


Closed Thread