Variables in CREATE TYPE should not be sorted
Status: Alpha
Brought to you by:
altumano
In an Oracle object type, the order of attributes is significant. PL/SQL will automatically create an implicit constructor taking each variable, and by sorting the plsql output, the signature of the constructor is hidden.
The example below shows the problem, without properly describing the scale of the problem. We have types with as many as 15 members, and then the proper order is quite essential.
Eirik
/** * Sample type, with two values. * * The default (implicit) constructor has all fields, in * order, so pldoc must preserve the variable order in output. * Create as sample_type(start_date, end_date). * * This comment should be in the output, too, as a description * of the type. */ CREATE OR REPLACE TYPE sample_type AS OBJECT ( /** Start date. First parameter, hence first parameter in constructor. */ start_date date, /** End date. Second value, hence second parameter in constructor */ end_date date ); /
For the record, a solution exists at https://github.com/elygre/pldoc2/commit/38006267ab3c56abd20d68e049a1dc2c507c6b4c.