Emulting Oracle packages in SQL Server RRS feed

  • Question

  • We are using the SSMA to convert our Oracle database to SQL Server 2008. We are doing this because the product has been sold to two different customers. The idea is to have to code as database agnostic as possible. We have just run into an issue and I am trying to understand how the emulation of packages works on the SQL server side. I have reviewed the white paper but have not found an answer.
    As an example we have a package called Personnel. Within that pack we have several methods. GET_ALL, GET_EMPLOYEE_NUMBER, REMOVE, SAVE.
    After migrating to SQL Server I see the package is spit into several stored procedures with one additional one PERSONNEL_PKG$SSMA_Initialize_Package.
    Are we suppose to call this stored proc in the same manner as we call the packages on the Oracle side?

    If more information is needed to explain please let me know.
    Monday, January 25, 2010 4:31 PM


  • There is no such thing as packages in SQL Server (unfortunately). So, what you do is from inside the "outer" procedure quite simplky execute the "inner" procedure (or function etc.). So in the outer proc code, you have something like:

    EXEC myInnerProc ...

    Tibor Karaszi, SQL Server MVP | http://www.karaszi.com/sqlserver/default.asp | http://sqlblog.com/blogs/tibor_karaszi
    • Proposed as answer by Amit Banerjee Wednesday, January 27, 2010 3:04 AM
    • Marked as answer by Alex Feng (SQL) Wednesday, February 3, 2010 1:51 AM
    Tuesday, January 26, 2010 1:04 PM