Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure Creation Error 1

Status
Not open for further replies.

ifxtechie

Technical User
Dec 22, 2000
127
US
Hi,
I am trying to create a simple stored procedure. But I am hitting to a starnge problem.

C:\temp>db2 -td@ -vf samp.sql
CREATE PROCEDURE get_count(OUT counter INT)
LANGUAGE SQL
BEGIN
DECLARE SQLSTATE CHAR(5);
DECLARE v_id CHAR(1);
DECLARE v_name VARCHAR(15);
DECLARE v_counter SMALLINT DEFAULT 0;
DECLARE at_end SMALLINT DEFAULT 0;

DECLARE not_found
CONDITION for SQLSTATE '02000';
DECLARE c1 CURSOR FOR
SELECT id, name
FROM stores;
DECLARE CONTINUE HANDLER for not_found
SET at_end = 1;
SET counter = 0;

OPEN c1;
fetch_loop:
LOOP
FETCH c1 INTO
v_id, v_name;
IF at_end <> 0 THEN LEAVE fetch_loop;
END IF;
SET v_counter = v_counter + 1;
END LOOP fetch_loop;
CLOSE c1;
SET counter = v_counter;
END
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0444N Routine "build_sqlroutine" (specific name "SQL040225135440430") is
implemented with code in library or path "\db2udp", function
"build_sqlroutine" which cannot be accessed. Reason code: "4".
SQLSTATE=42724
C:\temp>whereis vcvars32
C:\MicrosoftVisualStudio\VC98\bin/vcvars32.bat



I have included the path for Visual C++ compiler [vcvars32.bat]. Is there anything that I am missing? Can anybody help me in resolving this.
Thanks in advance.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top