File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android 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: 11175
    
  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: 1625
    
  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.
 
jQuery in Action, 2nd edition
 
subject: Using a Cursor to Retrieve Data From One Table and Insert Into Another table
 
Similar Threads
Closing cursor in a stored procedure when invoked from a callable statement
Looking for a good design for performance
Doubt on cursor position of resultset?
multiple inserts with multiple connections into same db table.
how to update multiple table in frame