DBD::Oracle woes

djberg96 on 2004-05-20T15:02:50

For some reason I couldn't remember if the tables() method returned just tables, or views as well. So, I installed the latest and greatest DBI and DBD::Oracle modules on my Winders box, connected to our mighty schema containing 4 tables and 2 views, and tried to get a list of tables. The result?

DBD::Oracle::db tables failed: ORA-02395: exceeded call limit on IO usage (DBD E RROR: OCIStmtExecute) [for Statement "SELECT * FROM ( SELECT /*+ RULE*/ NULL TABLE_CAT , t.OWNER TABLE_SCHEM , t.TABLE_NAME TABLE_NAME , decode(t.OWNER , 'SYS' , 'SYSTEM ' , 'SYSTEM' , 'SYSTEM ' , '' ) || t.TABLE_TYPE TABLE_TYPE , c.COMMENTS REMARKS FROM ALL_TAB_COMMENTS c , ALL_CATALOG t WHERE c.OWNER (+) = t.OWNER AND c.TABLE_NAME (+) = t.TABLE_NAME AND c.TABLE_TYPE (+) = t.TABLE_TYPE ) ORDER BY TABLE_TYPE, TABLE_SCHEM, TABLE_NAME "] at tablestest.pl line 8. DBD::Oracle::db tables failed: ORA-02395: exceeded call limit on IO usage (DBD E RROR: OCIStmtExecute) [for Statement "SELECT * FROM ( SELECT /*+ RULE*/ NULL TABLE_CAT , t.OWNER TABLE_SCHEM , t.TABLE_NAME TABLE_NAME , decode(t.OWNER , 'SYS' , 'SYSTEM ' , 'SYSTEM' , 'SYSTEM ' , '' ) || t.TABLE_TYPE TABLE_TYPE , c.COMMENTS REMARKS FROM ALL_TAB_COMMENTS c , ALL_CATALOG t WHERE c.OWNER (+) = t.OWNER AND c.TABLE_NAME (+) = t.TABLE_NAME AND c.TABLE_TYPE (+) = t.TABLE_TYPE ) ORDER BY TABLE_TYPE, TABLE_SCHEM, TABLE_NAME "] at tablestest.pl line 8. I'm not impressed.

Update: I guess this method has been deprecated in favor of the table_info() method since the last time I looked. Why it doesn't just default to "SELECT object_name FROM user_objects WHERE object_type IN ('TABLE', 'VIEW')" if no arguments are provided is beyond me. I just want an array of table names for chrissakes!