0

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.

migrated from stackoverflow.com May 2 '13 at 11:43

This question came from our site for professional and enthusiast programmers.

  • Not really, you'll need to rethink your logic for anything that used to create tables on the fly. Since you don't explain exactly what needs to be done, we can't really help you. – Mat May 2 '13 at 5:40
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy