3 ms·
Just as a heads up for anyone considering using Oracle's built-in support for temporary tables, there are a few restrictions [1], no support for distributed tra
by psYchotic 7y ago
Just as a heads up for anyone considering using Oracle's built-in support for temporary tables, there are a few restrictions [1], no support for distributed transactions being the main one I ran into at a previous client.
Taking into consideration the fact that you'll want to avoid hard parses [2][3] whenever possible, this leaves you the option of mimicking a temporary table manually (which will probably include having to manually fix statistics on your fake temporary table), or maybe use some string manipulation in your query to split a delimited list (which is itself limited to 4000 characters [4]).
That being said, I've been told that distributed transactions should themselves be avoided, so maybe look into that before getting mad at Oracle for what seems to be an arbitrary limitation on temporary tables.
[1]: https://docs.oracle.com/database/121/SQLRF/statements_7002.htm#SQLRF54448 https://docs.oracle.com/database/121/SQLRF/statements_7002.h...
[2]: https://docs.oracle.com/database/121/TGSQL/tgsql_sqlproc.htm#GUID-BFF0B26C-0A5D-4F79-B01E-8E1C4064A6AD https://docs.oracle.com/database/121/TGSQL/tgsql_sqlproc.htm...
[3]: https://blogs.oracle.com/sql/improve-sql-query-performance-by-using-bind-variables https://blogs.oracle.com/sql/improve-sql-query-performance-b...
[4]: https://docs.oracle.com/database/121/SQLRF/sql_elements001.htm#i45694 https://docs.oracle.com/database/121/SQLRF/sql_elements001.h...