|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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] |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Fast insertion required |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|