如何覆盖继承对象的构造函数?

时间:2015-10-28 12:42:01

标签: oracle oracle11g

这个脚本,我尝试"覆盖" $email = $_SESSION["email"] ; 的继承对象carree_t的构造函数,其中包含验证步骤。

rectangle_t

输出说: "警告:使用编译错误创建类型。"在Carree上。

和"显示错误;" => "没有错误。"

1 个答案:

答案 0 :(得分:1)

如果您在show errors语句后立即致电CREATE TYPE carree_t,您会看到:

LINE/COL ERROR
-------- --------------------------------------------------------------------------
3/5      PLS-00103: Encountered the symbol ")" when expecting one of the following:

         not pragma <an identifier>
         <a double-quoted delimited-identifier> final instantiable
         current delete exists order overriding prior static member
         constructor map

如果你等到成功编译了其他类型之后,那么show errors就不会向你显示任何内容,因为它会查找最新的对象。如果仍然没有向您显示任何内容,或者您​​只是想稍后查看you can query the user_errorsall_errors次观看,则会显示所有无效对象的错误。

在这种情况下,您只需在构造函数后面有一个逗号:

... RETURN SELF AS RESULT,       
    ) INSTANTIABLE FINAL

删除所有内容compiles with no errors

CREATE TYPE carree_t UNDER rectangle_t (
       CONSTRUCTOR FUNCTION carree_t (point_1 IN point_t, point_3 IN point_t)
           RETURN SELF AS RESULT      
    ) INSTANTIABLE FINAL
/
相关问题