Any query/command (single line or multiple line) we execute resides in the buffer temporarily and it is lost when we execute new query/command because new one takes that place. In case we try to edit that query/command which is in the buffer we get an error "SP2-0110: Cannot create save file "afiedt.buf"". There are many ways to fix this, I'm going to show you three different ways. 1. Always run the SQL Command Line as administrator.
Once you start this way, you will not see said error.
2. Sometimes we get this error message because we don't have write permission on the current directory. Either start sqlplus from a different directory, or change the editfile entry in sqlplus:
SQL>set editfile d:/sqledit.sql In above code, you can use any drive for this and any file name. 3. Create sqledit.sql file and save it in bin directory (sometimes this file misses cause this error) of oracle where sqlplus.exe is resides.Then run sql command line as administrator.
Method is block of PL/SQL code used to encapsulate the data access method for an object, it is also specified as part of the abstract datatype specification as (CREATE OR REPLACE TYPE MARKS_TY AS OBJECT) and their body declaration as (CREATE OR REPLACE TYPE BODY MARKS_TY AS MEMBER FUNCTION TOTMARKS()). Before to learn methods it is recommanded to get overview the abstract datatype teqniques.
CREATE OR REPLACE TYPE MARKS_TY AS OBJECT (M1 NUMBER(3), M2 NUMBER(3), M3 NUMBER(3), MEMBER FUNCTION TOTMARKS(M1 IN NUMBER, M2 IN NUMBER, M3 IN NUMBER) RETURN NUMBER);
In above example, TOTMARKS is declaration of function which will be used later in function calling to get defined.
Defining function (body declaration)
CREATE OR REPLACE TYPE BODY MARKS_TY AS MEMBER FUNCTION TOTMARKS(M1 NUMBER, M2 NUMBER, M3 NUMBER) RETURN NUMBER
Creating table using above abstract datatype MARKS_TY