The invention relates to the technical field of
database management, and provides a predefined query instruction PLSQLUNIT creating method,
system and equipment based on an openGauss
database, and the method comprises the following steps: in a
lexical analysis stage, identifying a predefined query instruction from the beginning; in the grammar
processing stage, a predefined query instruction is recognized as an expression, and corresponding content constants are obtained from compilation information and
database metadata for replacement; and creating a function corresponding to the predefined query instruction PLSQLUNIT, and obtaining compiling unit information through the function. According to the method, the migration convenience from the
Oracle to the openGauss can be improved; the code adjustment cost is reduced, the development efficiency of the
SQL and the PLSQL is enhanced, and the
code writing and maintenance work is simplified; the problem of
parsing conflict of symbols is solved, and the compatibility with original functions of openGauss is ensured; the name of the current compiling unit is dynamically acquired during compiling, and the
code readability and the operation efficiency are optimized; and through a predefined query instruction compatible with
Oracle, good ecological compatibility is kept.