Home » SQL & PL/SQL » SQL & PL/SQL » cursor (oracle 10g)
cursor [message #357858] Thu, 06 November 2008 23:16 Go to next message
ishika_20
Messages: 339
Registered: December 2006
Location: delhi
Senior Member
Dear All,

i want to insert 1000 records at a time.

following is my script.


INSERT INTO PCOM_CODES ( PC_TYPE, PC_CODE, PC_MC_CODE, PC_MAST_DEF_CODE, PC_DESC, PC_DESC_BL,
PC_SHORT_DESC, PC_SHORT_DESC_BL, PC_LONG_DESC, PC_LONG_DESC_BL, PC_CODE_BY_CLASS_YN, PC_CLASS_CODE,
PC_VALUE, PC_FLEX_01, PC_FLEX_02, PC_FLEX_03, PC_FLEX_04, PC_FLEX_05, PC_EFF_FM_DT, PC_EFF_TO_DT,
PC_CR_UID, PC_CR_DT, PC_UPD_UID, PC_UPD_DT, PC_FLEX_06, PC_FLEX_07, PC_FLEX_08, PC_FLEX_09,
PC_FLEX_10 ) VALUES (
'VEHI_CC', '5701', '01', 'VEHI_CC', '5701', '5701', '5701', '5701', '5701', '5701'
, '0', '10', '01', NULL, NULL, NULL, NULL, NULL, TO_Date( '01/01/2001 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM')
, TO_Date( '01/01/2025 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'), 'MEA', TO_Date( '01/01/2001 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM')
, NULL, NULL, NULL, NULL, NULL, NULL, NULL);



i want to enter values range from 5701 to 6500.

how can i insert at a time?

please provide me help

Thanks

[mod-edit] removed font for the visually impaired.

[Updated on: Fri, 07 November 2008 08:00] by Moderator

Report message to a moderator

Re: cursor [message #357861 is a reply to message #357858] Thu, 06 November 2008 23:27 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member


Try row generation technique with Conncet by clause

Smile
Rajuvan.
Re: cursor [message #357863 is a reply to message #357861] Thu, 06 November 2008 23:32 Go to previous messageGo to next message
ishika_20
Messages: 339
Registered: December 2006
Location: delhi
Senior Member
can you provide me some help?

Re: cursor [message #357865 is a reply to message #357858] Thu, 06 November 2008 23:38 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Search for "row generator".

Regards
Michel
Re: cursor [message #357867 is a reply to message #357865] Thu, 06 November 2008 23:44 Go to previous messageGo to next message
ishika_20
Messages: 339
Registered: December 2006
Location: delhi
Senior Member
instead of running each insert command, i want to insert at a time 5701 to 6500(ie: 799 rows )

how can i run through cursor?

hope cursor will work here.
Re: cursor [message #357870 is a reply to message #357867] Thu, 06 November 2008 23:54 Go to previous message
flyboy
Messages: 1832
Registered: November 2006
Senior Member
ishika_20 wrote on Fri, 07 November 2008 06:44
instead of running each insert command, i want to insert at a time 5701 to 6500(ie: 799 rows )

how can i run through cursor?

hope cursor will work here.

If you do not insist on cursor, you may do it in one SQL statement. Insert allows you to do it so in its multitable variant: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#i2163698
Row generator techniques for creating the query: http://www.orafaq.com/wiki/Oracle_Row_Generator_Techniques
Previous Topic: pass values to array parameter
Next Topic: %rowtype
Goto Forum:
  


Current Time: Sat Dec 03 08:06:29 CST 2016

Total time taken to generate the page: 0.07800 seconds