Home » SQL & PL/SQL » SQL & PL/SQL » How is naming Integrity Constants helpful? (11g)
How is naming Integrity Constants helpful? [message #578072] Sun, 24 February 2013 04:23 Go to next message
ashishpatel1992
Messages: 38
Registered: February 2013
Location: India
Member
How is naming Integrity Constants helpful?
See example below:-
create table incrr
  (incrid   number(4)   constraint incrid_pk primary key,
   incrdate date        not null,
   incramt  number(8,2) not null
  );

In the above if I don't use incrid_pk it also works.
Then what is the use of incrid_pk ?
Regards,
Ashish

[EDITED by LF: removed huge font formatting, reformatted code, applied [code] tags]

[Updated on: Sun, 24 February 2013 09:47] by Moderator

Report message to a moderator

Re: How is naming Integrity Constants helpful? [message #578073 is a reply to message #578072] Sun, 24 February 2013 04:26 Go to previous messageGo to next message
Michel Cadot
Messages: 58861
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
To easily find it when you search for primary keys or for objects related to your table.
Oracle does not care about the name you give, it is just for you (and the guys that will maintain your database or application).

Regards
Michel
Re: How is naming Integrity Constants helpful? [message #578074 is a reply to message #578073] Sun, 24 February 2013 04:27 Go to previous messageGo to next message
ashishpatel1992
Messages: 38
Registered: February 2013
Location: India
Member
How can I view the constraints defined by user?
Re: How is naming Integrity Constants helpful? [message #578075 is a reply to message #578074] Sun, 24 February 2013 04:38 Go to previous messageGo to next message
dariyoosh
Messages: 532
Registered: March 2009
Location: Iran / France
Senior Member
ashishpatel1992 wrote on Sun, 24 February 2013 11:27
How can I view the constraints defined by user?


Take a look at USER_CONSTRAINTS

Regards,
Dariyoosh
Re: How is naming Integrity Constants helpful? [message #578076 is a reply to message #578075] Sun, 24 February 2013 04:40 Go to previous messageGo to next message
ashishpatel1992
Messages: 38
Registered: February 2013
Location: India
Member
Is it mandatory to have these constraint name unique with respect to all tables under that user.
Regards,
Ashish
Re: How is naming Integrity Constants helpful? [message #578077 is a reply to message #578076] Sun, 24 February 2013 04:43 Go to previous messageGo to next message
dariyoosh
Messages: 532
Registered: March 2009
Location: Iran / France
Senior Member
ashishpatel1992 wrote on Sun, 24 February 2013 11:40
Is it mandatory to have these constraint name unique with respect to all tables under that user.
Regards,
Ashish


All you need to do is try to create a constraint with an already assigned name (to another database object) and see what oracle tells you.


Regards,
Dariyoosh
Re: How is naming Integrity Constants helpful? [message #578078 is a reply to message #578077] Sun, 24 February 2013 04:52 Go to previous message
ashishpatel1992
Messages: 38
Registered: February 2013
Location: India
Member
It says
name already used by an existing constraint
Thank you So Much for help. You are great!
Previous Topic: FIND INVOICE NOS AGAINST BALANCE VALUE
Next Topic: Need query
Goto Forum:
  


Current Time: Sat Aug 23 00:38:41 CDT 2014

Total time taken to generate the page: 0.13081 seconds