Toad World® Forums

Test problems with an Type...


Hi everybody,

i defined a type like this:
text VARCHAR2 (10 BYTE),
nummer NUMBER

and i defined a function like this:
CREATE OR REPLACE FUNCTION ALUCZAK.Returntypefromanytype (p_type my_type)
RETURN my_type – Return-Wert
v_returnvalue my_type := my_type(null,null);
v_returnvalue := p_type;
RETURN (v_returnvalue);
END Returntypefromanytype;

I would like to test this function but if i do so QCTO send an warning like this:
“Code Tester does not yet support native testing of this type.[…]” (see the picture i attached)
i understand, that Code tester doesn´t support my own type, but it must be possible to test my Function, isn´t it?!
How can i test this case?!

Andreas Luczak
ScriptV2_SQL4_Test(run mode when tas is opened in TDP).log (178 KB)


I am sorry about the delay in responding…we do not yet support native testing of object type methods - but that is our #1 priority at this very moment and we will soon post a beta with our first pass at this support.

In the meantime, you must build and test wrappers (packaged functions/procs) that call the OT methods after instantiating instances, etc.

You might also check out this:

    Testing attributes of object types

I hope this helps (a little bit anyway).




I’m afraid Steven overlooked that you’re not testing your object type directly. So did I the first time I read your post.

Seen that you’ve written a wrapper function you can test it in QCTO (in future versions of QCTO you’ll be able to do it directly as Steven mentioned). However, you need to use special code for initializing input parameter values and you need to base your outcome on an expression.

The following sections describe how you can do this.

Initialization of P_TYPE

Select the line with P_TYPE in Inputs in Test Builder. Click […] and write the following code:


or whatever values you would like to call your object type constructor with. I_P_TYPE is the name of the variable in the generated test code that holds the value of the input parameter P_TYPE.


You need to create an expression to be able to add an outcome as the error message indicates. Such an expression could be the following BOOLEAN expression:


where Q##FUNCTION_RETURN_VALUE is the name of the variable in the generated test code that holds the return value of the function. This expression checks whether the object type instance returned by the function is equal to the object type instance given as input. You can make an arbitrarily complex expression as long as the base data type is supported by QCTO such that you can match that against an expected value.

Hope this helps.

Best regards

Finn Ellebaek Nielsen