Home » SQL & PL/SQL » SQL & PL/SQL » insert (10g windows)
insert [message #307656] Wed, 19 March 2008 06:32 Go to next message
oracle_coorgi
Messages: 185
Registered: September 2006
Location: INDIA-karnataka
Senior Member
hi
i have three table t1 ,m1 ,output_table
i want to insert the records for each all pk_id for everymonth the output should be like sample output_table
how do i insert by procedure through cursor

t1	m1	output_table	
pk_id	mon	fk_id	mon_name
101	jan	101	jan
102	feb	101	feb
103	mar	101	mar
104	apr	101	apr
105	may	101	may
106	jun	101	jun
107	jul	101	jul
108		102	jan
109		102	feb
110		102	mar
111		102	apr
		102	may
		102	jun
		102	jul
Re: insert [message #307663 is a reply to message #307656] Wed, 19 March 2008 06:52 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Check the documentation for INSERT INTO... SELECT and Cartesian Products
Re: insert [message #307665 is a reply to message #307656] Wed, 19 March 2008 06:52 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
It looks like you want a cartesian product. Select from both tables without a join condition.

MHE
Re: insert [message #307666 is a reply to message #307656] Wed, 19 March 2008 06:53 Go to previous message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is called a cartesian product.

Regards
Michel
Previous Topic: ORA-01722
Next Topic: Oracle UTL_FILE exception read_error
Goto Forum:
  


Current Time: Tue Dec 06 12:08:24 CST 2016

Total time taken to generate the page: 0.11356 seconds