Home » SQL & PL/SQL » SQL & PL/SQL » Insert values into few columns
Insert values into few columns [message #349275] Fri, 19 September 2008 10:45 Go to next message
kavi123
Messages: 13
Registered: January 2007
Junior Member
Hi,

I had a situation where I need to insert values into few columns in a table avoiding inserting into some not null columns.Is it possible?Can anyone help on this?

Thanks,
Kavi123
Re: Insert values into few columns [message #349277 is a reply to message #349275] Fri, 19 September 2008 10:48 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
I don't understand.

You name the columns you want to insert data into.
You cannot ignore columns that have a NOT NULL constraint.
Re: Insert values into few columns [message #349280 is a reply to message #349275] Fri, 19 September 2008 10:53 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Put a default value in these columns definition.

Regards
Michel
Re: Insert values into few columns [message #349568 is a reply to message #349275] Mon, 22 September 2008 04:29 Go to previous message
gauravgg
Messages: 4
Registered: September 2008
Location: Bangalore,India
Junior Member
hi,

You cannot skip any NOT NULL columns in your column_name clause; otherwise the RDBMS will give you an error.
As stated by Michael,only default can avoid your situation.

u can check out this link
http://sqlbible.tar.hu/sqlbible0049.html

[Updated on: Mon, 22 September 2008 04:33]

Report message to a moderator

Previous Topic: varchar to value
Next Topic: Change Number to Time format
Goto Forum:
  


Current Time: Sat Dec 03 18:07:42 CST 2016

Total time taken to generate the page: 0.20126 seconds