Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Naming FKs
A copy of this was sent to "Doug Stone" <Doug_Stone_at_compuserve.com>
(if that email address didn't require changing)
On Thu, 27 Aug 1998 17:35:25 -0700, you wrote:
>Does anyone know if it is possible to name FKs?
>
>All the FKs in my DB are named by Oracle.
>
>Thank you,
>Doug
>
Inline in a create table, it would look like:
create table p ( x int constraint p_pk primary key );
create table c ( x int,
constraint c_pk primary key (x), constraint c_fk foreign key (x) references p(x) );
Out of line, as an alter table, it would look like:
create table p ( x int );
alter table p add constraint p_pk primary key(x);
create table c ( x int );
alter table c add constraint c_pk primary key (x); alter table c add constraint c_fk foreign key (x) references p(x);
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Fri Aug 28 1998 - 09:04:55 CDT
![]() |
![]() |