ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Object type of routine created

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

  • Object type of routine created

    Have written a simple procedure in SQL. Works perfectly...says that the routine <procedure name> is created in library <library name>

    However, what type of object is created when a routine is created ???

    I did a WRKOBJ <library name> / *all. However i dont see the name of my procedure at all in that list. However, my programs run perfectly fine.


    Your suggestions/ideas are most welcome.

  • #2
    Re: Object type of routine created

    Hi,

    I'm not quite sure, but AFAIK SQL procedure are created as *PGM objects (CLE : Ile C) and functions as *SRVPGM (CLE too).

    If you creates your sql proc with a name longer than 10 char, the system name (OS400) is autogenerated.

    You should find your proc and it's system name into the following table : QSYS2/SYSROUTINE. The system name is into column EXTERNAL_NAME
    Jean-Michel

    Comment


    • #3
      Re: Object type of routine created

      Hi jmp,

      This query gave me the desired results to find out all the procedures in the given library:
      SELECT * FROM QSYS2/SYSROUTINE WHERE SPECIFIC_SCHEMA ='<library name>' AND ROUTINE_TYPE = 'PROCEDURE'

      The following query also gave me the desired results:
      SELECT * FROM QSYS2/SYSprocs WHERE SPECIFIC_SCHEMA = '<library name>'

      However, i am not able to find its object type in the library.

      Please help

      Regards,
      Manty

      Comment


      • #4
        Re: Object type of routine created

        hi,

        with the following SQL sentence you will find the library and object name into column external_name :

        Code:
        SELECT  substr(ROUTINE_NAME, 1, 50), EXTERNAL_NAME 
         FROM QSYS2/SYSROUTINE WHERE SPECIFIC_SCHEMA       
        = '<library name>' AND ROUTINE_TYPE = 'PROCEDURE'
        Jean-Michel

        Comment


        • #5
          Re: Object type of routine created

          Hi jmp,

          Thanks for the information.

          Regards,
          Manty

          Comment

          Working...
          X