Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2002
    Posts
    8

    Unanswered: how to compile and call

    All,

    I am a newbie to DB2. We have UDB 7.1 version on sun solaris 2.7.
    I have a SQL stored procedure in script. Could someone let me know how to compile and call the stored procedure from command line
    and how to trap errors.

    Thanks a bunch in advance.

    Nilima

  2. #2
    Join Date
    Nov 2001
    Posts
    3
    Not sure what you are refering to compiling in DB2, but, the following will save your store procedure in DB2, if it's create statement is in the example name. (script.db2). Note be sure your script.db2 contains a 'connect to' statement at the beginning and a 'terminate' statement at the end. conclude each statement with a semicolon.


    db2 -tvf script.db2


    If you are refering to .SQC code using db2's PREP command you will need a C++ compiler and linkage editor.

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: how to compile and call

    For creating SQL Stored Procedure you require a C/C++ compiler installed on the server.

    Cheers

    Sathyaram

    Originally posted by nbandire
    All,

    I am a newbie to DB2. We have UDB 7.1 version on sun solaris 2.7.
    I have a SQL stored procedure in script. Could someone let me know how to compile and call the stored procedure from command line
    and how to trap errors.

    Thanks a bunch in advance.

    Nilima

  4. #4
    Join Date
    Dec 2002
    Posts
    2

    Re: how to compile and call

    Originally posted by sathyaram_s
    For creating SQL Stored Procedure you require a C/C++ compiler installed on the server.

    Cheers

    Sathyaram

  5. #5
    Join Date
    Dec 2002
    Posts
    2

    Re: how to compile and call

    Originally posted by sathyaram_s
    For creating SQL Stored Procedure you require a C/C++ compiler installed on the server.

    Cheers

    Sathyaram


    Do we need a C compiler on AIX to run a SQL stored procedure ?
    My SQL stored procedure for db2 works on the AIX development server but
    does not on the AIX production server.
    I get an error SQLCODE = -1103 and msgtoken=db2udp.
    I plan to ask the unix administrator to check for this file db2udp on the
    production server. Somebody mentioned to me that i need to have a C
    compiler on the production server. Why is this ?
    I thought an SQL stored procedure was compiled by a db2 program db2udp.
    Where does the C Compiler come into the picture ? ( this would only make
    sense if the stored procedure was converted to a c pgm which was then
    compiled by the c compiler. But this seems to be a bad approach by IBM)

  6. #6
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: how to compile and call

    As you mentioned, your stored procedure is converted to a C embedded SQL program and compiled ....

    I do not think you require a C compiler to execute your stored procedure, but, you will require C compiler to create the procedure ...
    From Version 7.2, it is sufficient to have the compiler on only one machine(for each OS). GET ROUTINE and PUT ROUTINE can be used to take procedures from dev to test to prod ...

    Cheers

    Sathyaram

    Originally posted by fillet70
    Do we need a C compiler on AIX to run a SQL stored procedure ?
    My SQL stored procedure for db2 works on the AIX development server but
    does not on the AIX production server.
    I get an error SQLCODE = -1103 and msgtoken=db2udp.
    I plan to ask the unix administrator to check for this file db2udp on the
    production server. Somebody mentioned to me that i need to have a C
    compiler on the production server. Why is this ?
    I thought an SQL stored procedure was compiled by a db2 program db2udp.
    Where does the C Compiler come into the picture ? ( this would only make
    sense if the stored procedure was converted to a c pgm which was then
    compiled by the c compiler. But this seems to be a bad approach by IBM)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •