Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2006
    Posts
    104

    Unanswered: Writing stored procedure in C

    Hi,

    We use DB2 7.2.9 on windows 2000 platform.
    we are after some good reference giving sample codes for writing stored procedures in C.

    Thanks in advance

    Harikumar
    Last edited by sundaram; 07-13-06 at 01:52.

  2. #2
    Join Date
    Jul 2006
    Location
    Bangalore
    Posts
    57
    you can write store procedures in C and java also.
    just write a procedue in c and crete its dll file.
    Then copy this dll file and put it following path

    C:\Program Files\IBM\SQLLIB\FUNCTION

    C is your drive where you have installed DB2

    Now after this create wrapper
    Ex.
    if your dll file name is abc.dll then

    CREATE procedure abc(<Arguments>)
    RETURNS <return data type>
    NOT FENCED
    RETURNS NULL ON NULL INPUT
    NO SQL
    DBINFO
    EXTERNAL ACTION
    LANGUAGE C
    PARAMETER STYLE DB2SQL
    EXTERNAL NAME 'abc!abc';

    then it will install procedure in your database and when you call that procedure it will internaly call that procedure which is written in C.
    Ritesh Kumar Singh
    IBM Certified DB2 DBA for LUW
    **Knowledge Is Theft If Not Shared !!**

  3. #3
    Join Date
    Mar 2006
    Posts
    104
    Thanks very much for that Ritesh. We are also after some sample codes and refrence for this. Any good reference for this (Db2 7.2 & Windows).

    Regards

    Harikumar

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Have you checked sqllib/samples directory
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  5. #5
    Join Date
    Mar 2006
    Posts
    104
    Checked Sathyaram. Not much, there. We are after some sample code that manipulate LOBs and also after some guidlines as to do's and don't. We are quite inexperienced in this area.

    Regards

    Harikumar

Posting Permissions

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