This content has been marked as final. Show 12 replies
Is there any error you get when inserting into table_b?
The way you do your inserting the the most ineffective way you can choose, simply use an insert as select, like1 person found this helpful
Edited by: Andreas Weiden on 14.04.2013 11:04
INSERT INTO table_b ( col1, col2, col3, col4 ) SELECT col1, col2, col3, col4 FROM table_a WHERE condition;
Hi1 person found this helpful
u need to declare ur variables val1,... etc.
the way Andreas used is faster than mine ...
but here is another example ...
To justify the concept u r trying to use...
...... BEGIN OPEN c1 ; LOOP /* Retrieve each row of the result of the above query into PL/SQL variables: */ FETCH c1 INTO V1 , V2 .... ; /* If there are no more rows to fetch, exit the loop: */ EXIT WHEN c1%NOTFOUND; -- insert ... INSERT INTO table_b VALUES(v1,v2,....); END LOOP; COMMIT; /* Free cursor used by the query. */ CLOSE c1; END;
No, gregor13. I am not getting any error.
thanks andreas, but still is not working for me.
thanks for reply amatu allah,
i have already tried before itself. it was not ableto insert.
then only i asked this question here.
now i have changed the code little.
now i am querying data on screen. i am getting data also.
but not getting idea how to insert that.
What did you change a little? I would also recommend to try that whole thing id sql*plus, where you directly can check the results.
Pls post ur code here or try to debug even by message
using toad or any db tool Will also be helpful
i am trying this in sql navigator it is working fine. only when i am trnasferring to forms 6i then only getting this problem.
This is because each has it's own compiler ...
Still unclear not able to help we need ur code to guide u to the right direction to the correct solution ...
My guess for now that u need to assign the variable to the form items of table_b then doing the insertion inside the loop ...
Form what trigger do you call your statement?
try to use exception:
begin FOR I IN C1 LOOP begin insert into table_b (col1, col2, col3, col4 ) values (val1, val2, val3, val4); commit; exception when others then null; --or log into another table end; END LOOP; end;