There are some weird things going on in SQL*Plus with it, so you can see it's not Toad. The sample below is with uniqueid varchar2(5).
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Last Successful login time: Thu May 30 2019 07:27:02 -05:00
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
SQL> SELECT a.street.city.region.uniqueid FROM vw_address a;
STREET.CIT
----------
HARRIS
SQL> select deref(region) from vw_city;
select deref(region) from vw_city
*
ERROR at line 1:
ORA-22814: attribute or element value is larger than specified in type
That query with deref isn't run in Toad. The query that Toad runs just selects the fields without deref, and there isn't any error. If Oracle gave an error, we'd throw it...but we don't get one, we just get null.
We don't just run some queries that give us the script. We run a bunch of queries, then process the results in our code to build the script. I can't give away all those details, but you can turn on Spool SQL in Toad to see the queries.
However, if you need to get DDL for an object without using Toad, the easiest way is to use DBMS_METADATA.GET_DDL (just google it for details, there are lots of examples online)
I have kept SQL monitoring on and found that below steps:
Getting list of all Types.
Extract Source
Finding dependencies.
Writing to File (But while writing it is arranging in exact sequence this is what I want to know how its arranging in sequence.) I dont see this in SQL monitoring.