我试图在Oracle内部使用OOP和TDD。是的,我知道这听起来很疯狂。而且,我需要一些建议。
我正在为以下构造函数方法编写测试(为了这个问题而简化):
CONSTRUCTOR FUNCTION PERSON(p_pidm NUMBER, p_throw_exception NUMBER DEFAULT 0, p_program_id NUMBER DEFAULT 0)
RETURN SELF AS RESULT IS
BEGIN
-- Attach constructor parameters to internal attributes
self.throw_exception := p_throw_exception;
self.program_id := p_program_id;
-- TESTING STUDENT INSTANTIATION
self.student := NEW STUDENT(self.a_pidm);
RETURN;
END;
在相应的测试中,我需要验证self.student
是否设置为STUDENT
的有效实例。在其他语言中,我使用typeof方法执行此操作,但我不知道PL / SQL中的一个。
所以,问题是,是否有人知道我可以将用户定义的类型传递给函数/过程并返回其类/类型名称?
感谢。
答案 0 :(得分:5)