ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

What determines library for SQL Package?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What determines library for SQL Package?

    When you use CRTSQLPKG on a *PGM object, what determines the library where the *SQLPKG object is created?

  • #2
    From the command help text:

    "Relational database (RDB)

    Specifies the relational database where the SQL package is being
    created."

    Defaults to *PGM.

    Cheers,

    Emmanuel

    Comment


    • #3
      But that's the database, not the library?


      Program on System_X, creating a *SQLPKG on System_Y with Database_Y

      If on system_X I do
      CRTSQLPKG PGM(LIB001/PGM001) RDB(DATABASE_Y)

      Then it creates the *SQLPKG on System_Y in library LIB002

      What determines LIB002?


      Comment


      • #4
        Yeah, I think you're right.

        According to: https://www.ibm.com/support/knowledg...bal1sqlpkg.htm, "The new SQL package has the same name and is placed in the same library as specified on the PKG parameter of the CRTSQLxxx command."

        I believe that should say: "...the SQLPKG parameter..."

        Cheers,

        Emmanuel

        Comment


        • #5
          Oh I see now!
          "PKG parameter of the CRTSQLxxx command" - I thought that was referring to the CRTSQLPKG command, but it's not, it's referring to the program/module compile command!

          So the library is set as a parameter of the CRTSQLRPGI command used to compile the program. I see now, thank you.

          Comment

          Working...
          X