Home » SQL & PL/SQL » SQL & PL/SQL » Insert with restrictions
Insert with restrictions [message #446777] Wed, 10 March 2010 07:11 Go to next message
sen_sam86
Messages: 33
Registered: August 2009
Location: Chennai
Member
I am Hvg a table with two columns
one is Emp_name Varchar2
Another is age Number

i want a simple insert that should restrict the entry if the age exceeds 50

You should not column contraints and all...
help me please
Re: Insert with restrictions [message #446778 is a reply to message #446777] Wed, 10 March 2010 07:14 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
i want a simple insert that should restrict the entry if the age exceeds 50

It is not clear what you want.
Post an example.

Quote:
You should not column contraints and all...

If you don't want anything, I wonder how you could achieve something.
I advice you to drop the table then you will not insert any row with age greater than 50.

Regards
Michel

[Updated on: Wed, 10 March 2010 07:29]

Report message to a moderator

Re: Insert with restrictions [message #446781 is a reply to message #446777] Wed, 10 March 2010 07:17 Go to previous messageGo to next message
glakshkar
Messages: 7
Registered: September 2005
Location: PUNE
Junior Member
Only 2 options available

1. Put CHECK Constraint on said column
2. Define trigger which check new value.

Regards
Re: Insert with restrictions [message #446782 is a reply to message #446778] Wed, 10 March 2010 07:17 Go to previous messageGo to next message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Michel Cadot wrote on Wed, 10 March 2010 18:44

I advice you to drop the table then you will not insert any row with age greater than 50.

Laughing
sriram Smile
Re: Insert with restrictions [message #446784 is a reply to message #446777] Wed, 10 March 2010 07:41 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
sen_sam86 wrote on Wed, 10 March 2010 13:11
I am Hvg a table with two columns
one is Emp_name Varchar2
Another is age Number

i want a simple insert that should restrict the entry if the age exceeds 50

You should not column contraints and all...
help me please

And have you actually tried to do any of this, or do you just expect others to do your homework for you?
Re: Insert with restrictions [message #446802 is a reply to message #446782] Wed, 10 March 2010 09:14 Go to previous messageGo to next message
sen_sam86
Messages: 33
Registered: August 2009
Location: Chennai
Member
@Nanterre

Try with check option <explitive removed>




CM: removed completely unecessary swearing.

[Updated on: Wed, 10 March 2010 09:16] by Moderator

Report message to a moderator

Re: Insert with restrictions [message #446804 is a reply to message #446777] Wed, 10 March 2010 09:17 Go to previous messageGo to next message
cookiemonster
Messages: 12403
Registered: September 2008
Location: Rainy Manchester
Senior Member
@sen_sam86 - don't use language like that, it's a violation of the forum rules and we're unlikely to want to help you if you swear at us.

Also not sure who you think that was addressed to but as far as I can see no-one called Nanterre has taken part in this thread.
Re: Insert with restrictions [message #446806 is a reply to message #446802] Wed, 10 March 2010 09:27 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
sen_sam86 wrote on Wed, 10 March 2010 15:14
@Nanterre

Try with check option <explitive removed>

Not much use on a table though is it?
Re: Insert with restrictions [message #446889 is a reply to message #446804] Wed, 10 March 2010 22:50 Go to previous message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
It might be a tamil word...

sriram Smile
Previous Topic: External Table
Next Topic: Execute immediate
Goto Forum:
  


Current Time: Fri Dec 02 18:18:49 CST 2016

Total time taken to generate the page: 0.18626 seconds