ChicagoKiwi wrote:
My DBA is a little mystified as to why I can't see the synonym. He's tried creating a public synonym as well as a private one to no avail.
The details of the synonym are: private synonym on ServerA in SchemaA pointing via a link to a view on ServerB in SchemaA (the schemas on the two servers have identical names, but are obviously different schemas, in different Oracle instances); the view on ServerB/SchemaA points to another synonym on ServerB in SchemaB which in turn points to a view on ServerB/SchemaB.
To confuse matters further the view on ServerB/SchemaA has the same name and result set as the original view the synonym replaces on ServerA/SchemaA
Could you give me some more details on how LLBLGen Pro determines that available synonyms and perhaps I can work out from that why it's not appearing?
Get all table synonyms:
SELECT * FROM ALL_SYNONYMS
WHERE
TABLE_NAME IN
(
SELECT TABLE_NAME FROM ALL_TABLES WHERE OWNER=ALL_SYNONYMS.TABLE_OWNER AND
TABLE_NAME=ALL_SYNONYMS.TABLE_NAME
)
AND OWNER='<currentschema>'
'<currentschema>' is for example 'SCOTT'.
get all view synonyms:
SELECT * FROM ALL_SYNONYMS
WHERE
TABLE_NAME IN
(
SELECT VIEW_NAME FROM ALL_VIEWS WHERE OWNER=ALL_SYNONYMS.TABLE_OWNER AND
VIEW_NAME=ALL_SYNONYMS.TABLE_NAME
)
AND OWNER='<currentschema>'
It then retrieves the fields for these retrieved synonyms, using 'TABLE_OWNER' and 'TABLE_NAME' to find the original table/view
Per found table /view synonym, this is executed:
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, NULLABLE, DATA_DEFAULT
FROM ALL_TAB_COLUMNS WHERE OWNER=:schemaOwner AND TABLE_NAME = :tableName
ORDER BY TABLE_NAME ASC, COLUMN_ID ASC
':schemaOwner' is a parameter, and for example 'SCOTT', and :tableName for example 'EMP'
If no rows are returned, the synonym is skipped. Then, all populated syn.view/table object is moved to table/view stores as normal table/view.