Sql-server – Migration of SQL Server to Oracle Database

migrationoraclesql server

In Sql server, my Procedure creates temporary tables where column names dynamically come from every user, then inserts data into temporary tables. I use the data further based on the requirement. Finally, we drop the temporary tables.

There is no problem when we create temporary tables with the same name and with different columns because in SQL Server the temporary tables are Session Based.

Now, I want to migrate the logic of the SQL Server code to Oracle. Is their any solution to achieve this requirement in Oracle Database Server.

Answers are greatly appreciated.

Best Answer

Global temporary tables in Oracle are very different, as they have a permanent logical definition and transient storage, so practically the reverse of your situation.

I would look at trying to avoid temporary tables at all, in favour of Common Table Expressions (WITH clauses). They are very powerful stuff and can transiently use temporary disk space if it aids performance.

Otherwise you'll have to manually code unique table names etc -- it'll be unpleasant to support in future.