Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Forms VS Apex dealing with custom datatypes.

motasem-shApr 12 2020 — edited Apr 12 2020

Dear All:

I know this could belong to another space, but it refers to Forms and Apex both.

This document is to demonstrate the difference of dealing with custom data types between Oracle Forms 11g and Oracle Apex 19.2,

The situation is, a project developed with Oracle Forms 11g using some custom user defined data types for specific reason, the project is working in many places.

Now we are planning to migrate the project to Oracle Apex 19.2 and we did a pilot project to enable some customers to access search pages online.

Before we go deep into migration we've gathered some information about the old project and we've found this problem of using custom data types.

I will demonstrate the case by using a demo table with user defined data type as:

create or replace type coordinations as object

(

x number,

y number,

name varchar2(50)

);

/

create table POINTS

(

id NUMBER,

location VARCHAR2(100),

co COORDINATIONS

);

Oracle Forms 11g:

I will create a form module on this table, you will notice that Oracle forms manage to define the type by itself and specify the attributes inside the type,

pastedImage_5.png

pastedImage_5.png

The data block created successfully and the layout is shown as

pastedImage_8.pngpastedImage_6.png

After running the form it can successfully manage the insert, update, query and delete on that table without any issue.

pastedImage_10.png

After monitoring the application on "Enterprise manager" the insert statement used by Oracle Forms engine was as follow:

pastedImage_11.png

You will notice that constructor of the type is used obviously inside the code.

Now let us do the same with Oracle APEX 19.2

Creating Form:

pastedImage_16.png

Notice that the type is not recognized at all (Anydata) and it gives the error as

pastedImage_17.png

1 error has occurred

  • ORA-20001: Unable to create form on table. ORA-20001: Unable to create form on table. ORA-20001: Error page=2 item="P2_CO" id="60140651379268601" ORA-02290: check constraint (APEX_190200.VALID_FSITEM_SOURCE_DATATYPE) violated

Trying to create IG instead of Form:

pastedImage_18.png

Here, the type is recognized at the beginning but later when expanding the IG columns you will see the column with type "COORDINATIONS" has "ANYDATA" data type.

The IG is based on the table "POINTS"

pastedImage_19.png

And the column CO has "ANYDATA (Invalid)" data type, without showing it's attributes

pastedImage_20.png

When trying to run the application and entering data this error appears

pastedImage_21.png

And some times it gives (strange behavior)

pastedImage_22.pngAnother try by creating IG with query:

If you try to base the IG on sql query as:

pastedImage_28.png

Now we have all columns plus attributes of the (type) shown individually

(select ID,

LOCATION,

t.CO.X,

t.CO.Y,

t.CO.NAME

from POINTS t)

when running the application and trying to enter data this error appears

pastedImage_29.png

Error: ORA-01733: virtual column not allowed here

The debug information is as follow:

- error_statement: insert into (select ID,

   LOCATION,

   t.CO.X,

   t.CO.Y,

   t.CO.NAME

from POINTS t

)

("ID","LOCATION","CO.X","CO.Y","CO.NAME")values(:APEX$VAL1,:APEX$VAL2,:APEX$VAL3,:APEX$VAL4,:APEX$VAL5)returning "ID" into :APEX$RET1

The generated insert statement by APEX engine doesn't recognize the type and it's constructor as the Oracle Forms 11g did.

Regards

Motasem Shkeir

Comments
Post Details
Added on Apr 12 2020
1 comment
435 views