PL/SQL (MOSC)

MOSC Banner

BULK Insert in 10gR2 database

edited Oct 29, 2012 2:13AM in PL/SQL (MOSC) 1 commentAnswered ✓
Hi,

I am trying to use BUlk insert and getting errors.

DECLARE

TYPE my_rec_tab IS TABLE OF my_table%ROWTYPE INDEX BY BINARY_INTEGER;

my_rec my_rec_tab;

CURSOR get_data

IS

SELECT * FROM MY_TABLE;

BEGIN

OPEN get_data;

FETCH get_data BULK COLLECT INTO my_rec;

CLOSE get_data;

DELETE FROM MY_TABLE;

COMMIT;

FORALL I IN my_rec.FIRST..my_rec.LAST

INSERT INTO MY_TABLE VALUES(my_rec(i));

EXCEPTION

WHEN OTHERS

THEN

DBMS_OUTPUT.PUT_LINE(SQLERRM);

END;

------------/*

When i run this block it says error PLS -009407 not enough values. Can anyone help

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center