I hope this isn't posted to the wrong area - my apologies if so. My question is very basic:
In PL/SQL, what determines where the program "begins"? I understand that there is three sections: declaritive, executable, and exception. From the VERY brief reading I've done (yes, I'm brand new to Oracle - I have programmed in some similar languages to PL/SQL, so I can understand the basic functionality) I'm having difficulty understanding something. But let me show you all a bit of code, with some questions:
CREATE OR REPLACE Package APPS.CUSTOM_STUDENT_LOAD
IS
PROCEDURE STUDENT_LOAD_MAINLINE;
g_last_name VARCHAR2(25) := 'SMITH';
PROCEDURE STUDENT_LOAD_MAINLINE
IS
CURSOR STUDENTS_C IS
SELECT *
FROM STUDENTS
WHERE LAST_NAME = g_last_name;
ABNORMAL_END exception;
BEGIN
FOR VENDOR_DATA IN STUDENTS_C LOOP
...
END LOOP;
END STUDENT_LOAD_MAINLINE;
END CUSTOM_STUDENT_LOAD;
There may be some syntax errors above, but can someone explain to me why the program automatically knows to start with the "BEGIN" statement? I ask because the "BEGIN" statement is nested inside the "STUDENT_LOAD_MAINLINE" procedure. So that procedure isn't technically "called" from the main program?
This program was already written and I'm picking up the pieces and am just trying to get a handle on it... Any feedback?
Thanks!
Steve
In PL/SQL, what determines where the program "begins"? I understand that there is three sections: declaritive, executable, and exception. From the VERY brief reading I've done (yes, I'm brand new to Oracle - I have programmed in some similar languages to PL/SQL, so I can understand the basic functionality) I'm having difficulty understanding something. But let me show you all a bit of code, with some questions:
CREATE OR REPLACE Package APPS.CUSTOM_STUDENT_LOAD
IS
PROCEDURE STUDENT_LOAD_MAINLINE;
g_last_name VARCHAR2(25) := 'SMITH';
PROCEDURE STUDENT_LOAD_MAINLINE
IS
CURSOR STUDENTS_C IS
SELECT *
FROM STUDENTS
WHERE LAST_NAME = g_last_name;
ABNORMAL_END exception;
BEGIN
FOR VENDOR_DATA IN STUDENTS_C LOOP
...
END LOOP;
END STUDENT_LOAD_MAINLINE;
END CUSTOM_STUDENT_LOAD;
There may be some syntax errors above, but can someone explain to me why the program automatically knows to start with the "BEGIN" statement? I ask because the "BEGIN" statement is nested inside the "STUDENT_LOAD_MAINLINE" procedure. So that procedure isn't technically "called" from the main program?
This program was already written and I'm picking up the pieces and am just trying to get a handle on it... Any feedback?
Thanks!
Steve