Hi Everyone,
Please go through the link below and clear my doubt.
https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:60122715103602
Then we can say, if there is a SQL query inside a PLSQL block, then for that SQL query; SQL engine will come into the picture and PLSQL engine will take care of the procedural code. Am I right here?
If this is true, then can someone enlighten me about "what is happening inside, and how this automated process works? And of course how Oracle will deal with this context switch? "
Do we have flow chart or diagram related to this?
Please do have a look at the sample code and let me know when the context switch will happen?
CREATE TABLE BS_TEST (ID NUMBER(4));
DECLARE
VN_NUM NUMBER(4);
BEGIN
SELECT MAX(ID) INTO VN_NUM FROM BS_TEST;
VN_NUM := NVL(VN_NUM, '0');
FOR I IN 1..1000
LOOP
VN_NUM := VN_NUM + 1;
INSERT INTO BS_TEST VALUES (VN_NUM);
END LOOP;
END;
/
Regards,
BS2012.