Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 9th, 2004, 06:31 AM
ramana_nv ramana_nv is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Bangalore, India
Posts: 96 ramana_nv User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 1 m 18 sec
Reputation Power: 5
Fast insertion required

hi All,

can i pass a result set from one function to one procedure as input parameter, and use the same
resultset to insert into some other table. My aim is insert the records fastly. I dont want fetch the
resultset and insert the records into table in sigle procedure. why because i am retrieving the data from
one database and inserting into some other remote database. Give me one example.

bye
ramana

Reply With Quote
  #2  
Old November 9th, 2004, 11:10 AM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,308 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 5 h 20 m 49 sec
Reputation Power: 48
The most sensible thing to do is to open a cursor that returns a recordtype (all fields in the source table) - the function returns NOT the data, but a REF CURSOR.

The procedure uses the REF CURSOR to fetch all of the rows.

look into the APPEND hint for faster insertions
Code:
INSERT /*+ APPEND */  INTO mytable .....


[/code]

Reply With Quote
  #3  
Old November 11th, 2004, 05:27 PM
hasnain hasnain is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 3 hasnain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
in and out parameters

create procedure p_insert
(p_get_value in Varchar2)
is
begin
insert into table values(p_get_value);
end;
/

create database link remote_db
connect to user identified by password
using 'service_name';


Create procedure p_passing
is
begin
p_insert@remote_db('Yourname');
end;
/


Rest is your job

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Fast insertion required


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT