*
The moose likes JDBC and the fly likes Using a Cursor to Retrieve Data From One Table and Insert Into Another table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Using a Cursor to Retrieve Data From One Table and Insert Into Another table" Watch "Using a Cursor to Retrieve Data From One Table and Insert Into Another table" New topic
Author

Using a Cursor to Retrieve Data From One Table and Insert Into Another table

seema chhetri
Ranch Hand

Joined: Feb 17, 2009
Posts: 41

Using a Cursor to Retrieve Data From One Table and Insert Into Another

i tried the below code but it couldnt helped...





thanks
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11149
    
  16

Nope. We don't hand out answers here. Folk will help YOU write it, but you need to Show Some Effort yourself.

Or, you can always make a post in "Jobs offered" and see if anyone will code it for a fee.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
chris webster
Bartender

Joined: Mar 01, 2009
Posts: 1606
    
  13

As Fred says, you should ShowSomeEffort.

However, here is a tip: Use "INSERT...SELECT" to perform the SELECT and the INSERT in a single statement e.g.
You should be able to figure it out from here.

[Edited my reply after I spotted the fairly obvious fact that you are using Oracle PL/SQL - doh!]


No more Blub for me, thank you, Vicar.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using a Cursor to Retrieve Data From One Table and Insert Into Another table
 
Similar Threads
Doubt on cursor position of resultset?
multiple inserts with multiple connections into same db table.
Looking for a good design for performance
Closing cursor in a stored procedure when invoked from a callable statement
how to update multiple table in frame