Home » SQL & PL/SQL » SQL & PL/SQL » Query Help
Query Help [message #602261] Mon, 02 December 2013 08:24 Go to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi all,


while inserting data from one table to another table old data should replace how to write this procedure using bulk insert or update. Could any one please help me how write Plz?


Thank you
Re: Query Help [message #602262 is a reply to message #602261] Mon, 02 December 2013 08:26 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
How can we write code when you do not provide ANY useful details like table name & column names?

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: Query Help [message #602264 is a reply to message #602262] Mon, 02 December 2013 08:29 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi BlackSwan,

Thank you for early reply, those tables are Customized tables , can you suggest with examples with on vision tables like any(emp,dept....), is this possible , if not i will post on tomorrow

Thank you
Re: Query Help [message #602266 is a reply to message #602264] Mon, 02 December 2013 08:33 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
mist598 wrote on Mon, 02 December 2013 06:29
Hi BlackSwan,

Thank you for early reply, those tables are Customized tables , can you suggest with examples with on vision tables like any(emp,dept....), is this possible , if not i will post on tomorrow

Thank you


I have NO idea what are your requirement or what solution would be acceptable.
INSERT is different from UPDATE operation & you mention both & I don't understand which needs to occur for you?

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: Query Help [message #602267 is a reply to message #602261] Mon, 02 December 2013 09:30 Go to previous messageGo to next message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
Sounds like a job for
Da Dadadadadadadaaaaa
Merge
Re: Query Help [message #602394 is a reply to message #602267] Wed, 04 December 2013 00:11 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi all,
i want a procedure that
if exists(select statement)then update tablename where condition else insert into

but select statement contains nearly 130 columns i have to update all columns if requried then for this in where condition again i sholud add all columns but without that how can i update and insert using bulk collect only

Thank you

Re: Query Help [message #602400 is a reply to message #602394] Wed, 04 December 2013 01:37 Go to previous messageGo to next message
John Watson
Messages: 8929
Registered: January 2010
Location: Global Village
Senior Member
Sounds like a job for (crash of cymbals)
merge
Re: Query Help [message #602402 is a reply to message #602400] Wed, 04 December 2013 02:05 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi John,

Thank you for reply, is this not possible using BULK COLLECT collection?

Thank you
Re: Query Help [message #602406 is a reply to message #602402] Wed, 04 December 2013 02:44 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Sure it is, but if you can do it in a single merge statement that will be faster.
Re: Query Help [message #602407 is a reply to message #602406] Wed, 04 December 2013 02:47 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi cookiemonster,

Thank you for early reply, could you please provide me sample code on this please

Thank you
Re: Query Help [message #602408 is a reply to message #602407] Wed, 04 December 2013 02:56 Go to previous message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
The documentation has plenty of examples, I don't see any need to repeat them here.
Previous Topic: How to Refresh User_tables
Next Topic: Order by some columns
Goto Forum:
  


Current Time: Fri Apr 19 08:03:59 CDT 2024