Home » SQL & PL/SQL » SQL & PL/SQL » insert with condition
insert with condition [message #356917] Mon, 03 November 2008 02:17 Go to next message
rags11
Messages: 21
Registered: October 2008
Junior Member
Hi,
while doing insertion into a table with 20 columns,i want to verify for one column value to be existing in another table.
i dont want to do the validation before insert statement and
can this be possible in insert statement itself?

Thank You.

Re: insert with condition [message #356922 is a reply to message #356917] Mon, 03 November 2008 03:24 Go to previous messageGo to next message
flyboy
Messages: 1903
Registered: November 2006
Senior Member
Hi,
this can be obtained by one of the basic database concepts: referential integrity constraint.
As you did not post the Oracle version, search for it in the documentation (Concepts and SQL Reference books) yourself. It is available e.g. online on http://tahiti.oracle.com/.
Re: insert with condition [message #356931 is a reply to message #356922] Mon, 03 November 2008 04:40 Go to previous messageGo to next message
rags11
Messages: 21
Registered: October 2008
Junior Member
no man..i dont have that tables linked and i should not link them also becuase they are not my db tables.
let me know if you know any other way having exists in insert statement.

Thanks
Re: insert with condition [message #356934 is a reply to message #356931] Mon, 03 November 2008 04:44 Go to previous messageGo to next message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
you can try with trigger where you will be using :new. and :old.
it is only a hunch
Re: insert with condition [message #356935 is a reply to message #356931] Mon, 03 November 2008 04:44 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
SQL, where clause.

Regards
Michel
Re: insert with condition [message #356937 is a reply to message #356935] Mon, 03 November 2008 04:50 Go to previous message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
Quote:

for one column value to be existing in another table.





sorry... i missed the quoted words
Previous Topic: BULK insert
Next Topic: interchanging values
Goto Forum:
  


Current Time: Mon Feb 17 18:23:06 CST 2025