[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Error building a Stored Procedure

Posted on 2004-11-19
5
Medium Priority
?
470 Views
Last Modified: 2008-02-01
Hello all I am new to this environment and in process of creating the following procedure.
I am getting errors could some one help me.
Thanks

CREATE PROCEDURE SESS.GETDATA ( IN SESSID varchar(50),
                                   IN KEYNAME varchar(50),
                                   IN OPERATION varchar(50),
                                   IN L_EVENT varchar(50),
                                   IN PARENTKEY varchar(50) )
    SPECIFIC SESS.GETDATA
    DYNAMIC RESULT SETS 1
    LANGUAGE SQL

P1: BEGIN
    -- Declare cursor
    DECLARE cursor1 CURSOR WITH RETURN TO CALLER FOR
        SELECT KEY_VAL
        FROM SESS.SESSION;

    -- Cursor left open for client application
    OPEN cursor1;

END P1


when i use SPB, it's giving me SQL091N The SQL Statement failed because of a
non-severe system error.  Subsequent statements can be processed (Reason "Error while generating C source code".)
SQLSTATE = 58004
It was giving me a different error if I use Command Center
0
Comment
Question by:devtha
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
BigSchmuh earned 1000 total points
ID: 12633245
DB2 needs a C Compiler installed on the SERVER for it to compile your stored procedures...
Better get a close look at the "Application Building Guide" (v7 release below) chapter 5-Building SQL procedures/Setting the SQL environment
   ftp://ftp.software.ibm.com/ps/products/db2/info/vr7/pdf/letter/db2axe71.pdf

Hope this helps.
0
 
LVL 6

Author Comment

by:devtha
ID: 12640274
I am not the admin for this server. Perhaps it is a DBA task.
I can ask the DBA to check it for me.
Have you tried creating the sp in your environment?
 
0
 
LVL 18

Expert Comment

by:BigSchmuh
ID: 12641926
I guess "Error while generating C source code" does not need to be checked on my environment and I don't have one at the moment...
==> But the problem is always the same, caming from Oracle and MsSql I was used to be able to compile my sp directly on the dbms, but DB2 needs a C compiler and some environment variables setted to compile correctly

I guess asking the DBA is a good idea
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Integration Management Part 2
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question