If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Error 1034 while creating a Stored Procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-19-07, 16:26
psneto psneto is offline
Registered User
 
Join Date: Apr 2007
Posts: 2
Error 1034 while creating a Stored Procedure

Hi guys!

I'm facing with the Error -1034C while trying to create Stored procedure on all databases that I have.

--- Here is the Stored Procedure savend in the file createSQLproc.db2:

CREATE PROCEDURE sales_status
(IN quota INTEGER, OUT sql_state CHAR(5))
DYNAMIC RESULT SETS 1
LANGUAGE SQL
BEGIN
DECLARE SQLSTATE CHAR(5);
DECLARE rs CURSOR WITH RETURN FOR
SELECT sales_person, SUM(sales) AS total_sales
FROM sales
GROUP BY sales_person
HAVING SUM(sales) > quota;
OPEN rs;
SET sql_state = SQLSTATE;
END @

--- here is the command I'm using:
db2 -td@ -vf createSQLProc.db2

--- Here is the error:

DB21034E The command was processed as an SQL Statement because it was not a valid command Line processor command. During SQL processing it returned:
SQL1034C The database is damaged. All applications processing the database have been stopped. SQLSTATE=58031

----
I also tried to create using the Development Center but I got the same error.

Thanks in advance for any help
Reply With Quote
  #2 (permalink)  
Old 04-20-07, 00:48
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
I think database is damaged bcoz of some other reason not related to this SP.
Issue a RESTART DATABASE command to recover the database. If the
RESTART command consistently fails, you may want to restore the
database from a backup.
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
  #3 (permalink)  
Old 04-20-07, 09:18
psneto psneto is offline
Registered User
 
Join Date: Apr 2007
Posts: 2
Hi Rahul!

I issued the RESTART DATABASE command and the error still persists.
Also I tried to create another SP on another database and I got the same error. Maybe something is wrong in my configurations.

here is my configuration values:

DB2_SQLROUTINE_COMPILER_PATH = "C:\Program Files\Microsoft Visual Studio 8\VC\bin\VCVARS32.BAT"

DB2_SQLROUTINE_COMPILE_COMMAND = "COMMAND="cl -Od -W2 /TC -D_X86_=1 -I%DB2PATH%\include SQLROUTINE_FILENAME.c /link -dll -defQLROUTINE_FILENAME.def /outQLROUTINE_FILENAME.dll %DB2PATH%\lib\db2api.lib"

thanks again!
Reply With Quote
  #4 (permalink)  
Old 04-21-07, 05:14
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Which version of DB2 are you using on which platform? Since V8.2, you don't need a C compiler any longer so I would recommend that you move to V8.2 or V9.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On