Tongas wrote:
Well, I think I found the error.
The query which findout if a table have a PK, is not taking in acount the double cuotes in the name of my tables. So, the query return no rows when it try to obtain the FKs from the ALL_CONSTRAINTS view (or wathever it use)
Is there a way I could configure my LLBL, in order to take in consideration that my table name is "MyTableName" and not MYTABLENAME ???
This is the query which determines the PK's:
SELECT ALL_CONS_COLUMNS.TABLE_NAME,
ALL_CONS_COLUMNS.COLUMN_NAME,
ALL_CONS_COLUMNS.POSITION
FROM ALL_CONS_COLUMNS, ALL_CONSTRAINTS
WHERE
ALL_CONS_COLUMNS.CONSTRAINT_NAME = ALL_CONSTRAINTS.CONSTRAINT_NAME
AND ALL_CONS_COLUMNS.OWNER = ALL_CONSTRAINTS.OWNER
AND ALL_CONSTRAINTS.CONSTRAINT_TYPE='P'
AND ALL_CONSTRAINTS.OWNER='schema'
ORDER BY ALL_CONS_COLUMNS.TABLE_NAME, ALL_CONS_COLUMNS.COLUMN_NAME, ALL_CONS_COLUMNS.POSITION
so 'Schema' can be 'SCOTT' for example.
The name is then read directly from the datatable filled with the result:
currentTableName = pkFields.Rows[ i]["TABLE_NAME"].ToString().Trim();
So, IF there are quote's, they're there.
When you execute the query in TOAD or other query tool, you get a name surrounded with quotes ?
The table fields retrieval routine also uses a similar query:
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, NULLABLE, DATA_DEFAULT FROM ALL_TAB_COLUMNS WHERE OWNER='schema' AND
TABLE_NAME = :tableName ORDER BY TABLE_NAME ASC, COLUMN_ID ASC
where 'schema' is 'SCOTT' for example and :tableName is a parameter, filled with the table name read earlier by the table retrieval routine.
So I'm a bit lost where the problem is as I know for a fact several customers with case sensitive names for tables, created with quotes use it succesfully.