城乡建设管理局的网站,响应式网站 拖拽,惠州网站制作计划,一键优化为什么不能100文章目录 背景语法示例 背景
在信创适配中#xff0c;从Oracle迁移过来的程序使用authid current_user。为此LightDB从24.1版本开始#xff0c;对该功能进行了语法层面上的支持。
语法 CREATE [ OR REPLACE ] TYPE name opt_invoker_rights_clause as_is OBJECT ( [ object… 文章目录 背景语法示例 背景
在信创适配中从Oracle迁移过来的程序使用authid current_user。为此LightDB从24.1版本开始对该功能进行了语法层面上的支持。
语法 CREATE [ OR REPLACE ] TYPE name opt_invoker_rights_clause as_is OBJECT ( [ object_type_element_list ] )where opt_invoker_rights_clause is:[ AUTHID CURRENT | AUTHID DEFINER ]and as_is is:AS | ISand object_type_element_list is:TableFuncElementList [ object_type_func_list ]and TableFuncElementList is:attribute_name data_type [ COLLATE collation ] [, ... ]and object_type_func_list is:{ type_function_spec | type_procedure_spec } [, ... ]and type_function_spec is:MEMBER FUNCTION func_name ( [ [ argmode ] [ argname ] argtype [ { DEFAULT | } default_expr ] [, ...] ] ) RETURN rettypeSTATIC FUNCTION func_name ( [ [ argmode ] [ argname ] argtype [ { DEFAULT | } default_expr ] [, ...] ] ) RETURN rettypeand type_procedure_spec is:MEMBER PROCEDURE func_name ( [ [ argmode ] [ argname ] argtype [ { DEFAULT | } default_expr ] [, ...] ] )STATIC PROCEDURE func_name ( [ [ argmode ] [ argname ] argtype [ { DEFAULT | } default_expr ] [, ...] ] )CREATE [ OR REPLACE ] TYPE BODY name as_is subprog_decl_in_type_list ENDwhere subprog_decl_in_type_list is:{ func_decl_in_type | proc_decl_in_type } [ ... ]and func_decl_in_type is:MEMBER FUNCTION func_name ( [ [ argmode ] [ argname ] argtype [ { DEFAULT | } default_expr ] [, ...] ] ) RETURN rettype as_is pl_block ;STATIC FUNCTION func_name ( [ [ argmode ] [ argname ] argtype [ { DEFAULT | } default_expr ] [, ...] ] ) RETURN rettype as_is pl_block ;and proc_decl_in_type is:MEMBER PROCEDURE func_name ( [ [ argmode ] [ argname ] argtype [ { DEFAULT | } default_expr ] [, ...] ] ) as_is pl_block ;STATIC PROCEDURE func_name ( [ [ argmode ] [ argname ] argtype [ { DEFAULT | } default_expr ] [, ...] ] ) as_is pl_block ;and as_is is:AS | ISand pl_block is:[ DECLARE decl_stmts ] BEGIN statement [ , ... ] END示例
CREATE OR REPLACE TYPE tp_point authid current_user as object (x int,y int,member procedure plus_x(v number),member procedure plus_y(v number),static procedure p_display(p tp_point),static function f_display(p tp_point) return varchar
);CREATE OR REPLACE TYPE BODY tp_point AS member procedure plus_x(v number) is BEGINself.x : self.x v;end;member procedure plus_y(v number) is BEGINself.y : self.y v;end;static procedure p_display(p tp_point) is BEGINdbms_output.put_line(x || p.x || , || y || p.y);end;static function f_display(p tp_point) return varchar is BEGINreturn x || p.x || , || y || p.y;end;
END;
/declarep tp_point : tp_point(1.0, 2.0);
BEGINtp_point.p_display(p);p.plus_x(1.0);p.plus_y(2.0);dbms_output.put_line(tp_point.f_display(p));
end;
/
x1,y2
x2,y4
DO