my $SQL_query;
$SQL_query = qq {SELECT A.DISPLAY_ORDER, A.NAME
PARENT_NAME, B.NAME CHILD_NAME
FROM CATEGORY A, CATEGORY B
WHERE B.ID_PARENT_CATEGORY(+) = A.ID_CATEGORY
AND A.DISPLAY_ORDER != -1 ORDER BY DISPLAY_ORDER};
Just a suggestion -- Oracle, SQL Server, Sybase, and others tend to use idiosyncratic ways of expressing joins. Using the ANSI join specifications will make your code more portable between RDBMS implementations. For example:
SELECT A.DISPLAY_ORDER, A.NAME PARENT_NAME, B.NAME CHILD_NAME
FROM CATEGORY A
LEFT OUTER JOIN CATEGORY B
ON B.ID_PARENT_CATEGORY = A.ID_CATEGORY
I know that Sybase, SQL Server, Postgres and Oracle all support ANSI joins, and I suspect there are others as well.
-----
"Computeri non cogitant, ergo non sunt"