Instead of overriding code, the search macro provides a search and replace pattern.
Category: layer_control
Code in a lower layer can be changed in different ways by adding $SEARCH, $REPLACE, $APPEND, $PREPEND, $ADD and $END macro instructions
... $SEARCH code to search for ... $REPLACE code to replace with ... $END ...
... $SEARCH code to search for ... $REPLACE $END ...
... $PREPEND code to add ... $SEARCH code to search for ... $END ...
... $SEARCH code to search for ... $APPEND code to follow after ... $END ...
... $PREPEND code to add ... $SEARCH code to search for ... $APPEND code to follow after ... $END ...
@Overtake PROCEDURE Set_Salary ( salary_ IN NUMBER ) IS $SEARCH code to search for ... $APPEND code to append ... $END BEGIN $NULL END Set_Salary;
@Overtake PROCEDURE Calculate_Cost ( order_amount_ IN NUMBER ) IS $ADD declaration to add ... $END BEGIN $NULL END Calculate_Cost;
Note: The code must be written in such a way that it can be parsed as-if the macro commands were comments. If that cannot be accomplished, then the commands $TEXTSEARCH, $TEXTREPLACE, $TEXTAPPEND, $TEXTPREPEND and $TEXTEND can be used instead.
--@Overtake Base FUNCTION Get_Title ( movie_id_ IN NUMBER, default_title_ IN VARCHAR2 DEFAULT 'Oblivion' ) RETURN VARCHAR2 IS BEGIN $SEARCH IF (movie_id_ IS NULL) THEN RETURN NULL; END IF; $REPLACE IF (movie_id_ IS NULL) THEN RETURN default_title_; END IF; $END END Get_Title;
Note: *** Commented lines with $KEYWORDS, do not get ignored during the code generation, even it's commented out using single-line comment "--". It is a known limitation in PLSQL, PLSVC and VIEWs files. Instead use multi-line comment "/* */" to comment out unnecessary lines with $ Keywords. Examples as follows:
-- Use multi-line comment to comment out the line with $TEXTSEARCH, if you want to ignore the line when generating code. FUNCTION Get_Title ( movie_id_ IN NUMBER, default_title_ IN VARCHAR2 DEFAULT 'Oblivion' ) RETURN VARCHAR2 IS BEGIN $SEARCH IF (movie_id_ IS NULL) THEN RETURN NULL; END IF; $REPLACE /* $TEXTSEARCH does not need to be used here as we have a valid PL/SQL line. */ IF (movie_id_ IS NULL) THEN RETURN default_title_; END IF; $END END Get_Title;
-- Do NOT use single-line comment to comment out the line with $TEXTSEARCH, it doesn't get ignored during code generation. FUNCTION Get_Title ( movie_id_ IN NUMBER, default_title_ IN VARCHAR2 DEFAULT 'Oblivion' ) RETURN VARCHAR2 IS BEGIN $SEARCH IF (movie_id_ IS NULL) THEN RETURN NULL; END IF; $REPLACE -- $TEXTSEARCH does not need to be used here as we have a valid PL/SQL line. IF (movie_id_ IS NULL) THEN RETURN default_title_; END IF; $END END Get_Title;
This page is generated from IFS Developer Studio at 2021-03-10 14:56.