473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

create procedure problem - db2 8.2.3 (DPF) on AIX - help?

Hi All;
I have what I hope is a simple environmental problem. I have some SQL
that creates a VERY simple procedure. When the create is executed from
Quest (from a Windows client) - no problem. As soon as I go to the
command line (on the actual DB server), I get a strange (and somewhat
frightening) sqlcode -1007 (corrupt tablespace!?). I'm pretty sure it
has something to do with CLP/statement terminator behavior, but cannot
find the recipe for success. Any help really appreciated!

Here's the SQL that runs fine from Windows/Quest:

CREATE PROCEDURE DVLXTRCT_TEST_ECHO_SP
(IN P_ECHO_TEXT CHARACTER(50)
)
DYNAMIC RESULT SETS 1
LANGUAGE SQL
NOT DETERMINISTIC
CALLED ON NULL INPUT
READS SQL DATA
INHERIT SPECIAL REGISTERS
pgm: begin
DECLARE c1 CURSOR WITH RETURN TO CALLER FOR
values(P_Echo_Text)
;
-- to return result set, do not CLOSE cursor
OPEN c1;
end;
================================================== =======
================================================== =======
Here is my command line session with the sqlcode:
--db2 connect to xxxxx

Database Connection Information

Database server = DB2/AIX64 8.2.3
SQL authorization ID = xxxxxxxx
Local database alias = xxxxxxxxxxx

--db2 -atf pete_test_proc.ddl
SQLCA Information

sqlcaid : SQLCA sqlcabc: 136 sqlcode: 1007 sqlerrml: 0
sqlerrmc:
sqlerrp : SQL08023
sqlerrd : (1) 0 (2) 0 (3) 0
(4) 0 (5) 0 (6) 0
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate:
explanation of sqlcode -1007
----------------------------------------------------------
User Response:

Discontinue use of the object or table space. Contact IBM service
to inspect the object and the table space.

sqlcode : -1007

================================================== ==================
================================================== ==================

I have tried replacing the semi-colons with @, but get the same error.
Help?!

Pete H

Aug 29 '06 #1
8 4898
Raj
I replaced the semi column with an @ and ran it as db2 -td@ -vsf
proc.sql and it compiles succesfully. But the error you got it
weird.... try runnning inspect or db2dart on the db

Aug 29 '06 #2
Raj wrote:
I replaced the semi column with an @ and ran it as db2 -td@ -vsf
proc.sql and it compiles succesfully. But the error you got it
weird.... try runnning inspect or db2dart on the db
Pete,

Are you sure you didn't misread the SQLCODE? The parser spits
essentially two error codes -104 (syntax error) and -007:
SQL0007N The character "<character>" following "<text>" is
not valid.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Aug 29 '06 #3
Hi Serge;
Below is the actual screen print from my AIX command line:
--db2 -atf pete_test_proc.ddl
SQLCA Information
sqlcaid : SQLCA sqlcabc: 136 sqlcode: 1007 sqlerrml: 0
sqlerrmc:
sqlerrp : SQL08023
sqlerrd : (1) 0 (2) 0 (3) 0
(4) 0 (5) 0 (6) 0
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate:

Is CLP doing something funky to SQLCA? That might be even more
frightening than a corrupt tables space :-o
Pete H
------------------------------------------------------
Serge Rielau wrote:
Raj wrote:
I replaced the semi column with an @ and ran it as db2 -td@ -vsf
proc.sql and it compiles succesfully. But the error you got it
weird.... try runnning inspect or db2dart on the db
Pete,

Are you sure you didn't misread the SQLCODE? The parser spits
essentially two error codes -104 (syntax error) and -007:
SQL0007N The character "<character>" following "<text>" is
not valid.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Aug 29 '06 #4
Thanks Raj;
I too tried the @ replacement and got the same error. Is this what you
ran (below)?
================================================== ==========
--db2 connect to xxxxxxxx

Database Connection Information

Database server = DB2/AIX64 8.2.3
SQL authorization ID = xxxxxxxx
Local database alias = xxxxxxxx

--db2 -atf dvlxtrct.pete_test_proc.ddl
SQLCA Information

sqlcaid : SQLCA sqlcabc: 136 sqlcode: 1007 sqlerrml: 0
sqlerrmc:
sqlerrp : SQL08023
sqlerrd : (1) 0 (2) 0 (3) 0
(4) 0 (5) 0 (6) 0
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate:

--more dvlxtrct.pete_test_proc.ddl

CREATE PROCEDURE DVLXTRCT_TEST_ECHO_SP
(IN P_ECHO_TEXT CHARACTER(50)
)
DYNAMIC RESULT SETS 1
LANGUAGE SQL
NOT DETERMINISTIC
CALLED ON NULL INPUT
READS SQL DATA
INHERIT SPECIAL REGISTERS
pgm: begin
DECLARE c1 CURSOR WITH RETURN TO CALLER FOR
values(P_Echo_Text)@
OPEN c1@
end@
=================================================
Raj wrote:
I replaced the semi column with an @ and ran it as db2 -td@ -vsf
proc.sql and it compiles succesfully. But the error you got it
weird.... try runnning inspect or db2dart on the db
Aug 29 '06 #5
Raj
This is the proc.sql
----------------------
CREATE PROCEDURE DVLXTRCT_TEST_ECHO_SP
(IN P_ECHO_TEXT CHARACTER(50)
)
DYNAMIC RESULT SETS 1
LANGUAGE SQL
NOT DETERMINISTIC
CALLED ON NULL INPUT
READS SQL DATA
INHERIT SPECIAL REGISTERS
pgm: begin
DECLARE c1 CURSOR WITH RETURN TO CALLER FOR
values(P_Echo_Text)
;
-- to return result set, do not CLOSE cursor
OPEN c1;
end
@
----------------------------------------
the statement i used to compile: db2 -td@ -vsf proc.sql

Aug 29 '06 #6
Raj-
Thanks so much for your help. I have gotten the compile to work. It
appears to be my lack of knowleddge of CLP/statement terminator
behavior and a misleading sqlcode that are the issues.

If I could ask you for one more favor, could you help me understand the
CLP options you used so that I can integrate DROP and GRANT statements
into what I'm submitting via CLP?

In effect, I want to do this:
DROP PROCEDURE DVLXTRCT_TEST_ECHO_SP2
;
CREATE PROCEDURE DVLXTRCT_TEST_ECHO_SP2
(IN P_ECHO_TEXT CHARACTER(50)
)
DYNAMIC RESULT SETS 1
LANGUAGE SQL
NOT DETERMINISTIC
CALLED ON NULL INPUT
READS SQL DATA
INHERIT SPECIAL REGISTERS
pgm: begin
DECLARE c1 CURSOR WITH RETURN TO CALLER FOR
values(P_Echo_Text)
;
-- to return result set, do not CLOSE cursor
OPEN c1;
end;

GRANT EXECUTE ON PROCEDURE DVLXTRCT_TEST_ECHO_SP2 TO PUBLIC
@

When I do, I get the following:
--db2 -td@ -vsf dvlxtrct.pete_test_proc.ddl
GRANT EXECUTE ON PROCEDURE DVLXTRCT_TEST_ECHO_SP2 TO PUBLIC
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0104N An unexpected token "DROP PROCEDURE DVLXTRCT_TEST_ECHO_SP2
;" was
found following "BEGIN-OF-STATEMENT". Expected tokens may include:
"<space>". SQLSTATE=42601

It's clear I have to dig into the CLP environment and educate myself,
but GREATLY appreciate your help!

Pete H

===========================================
Raj wrote:
This is the proc.sql
----------------------
CREATE PROCEDURE DVLXTRCT_TEST_ECHO_SP
(IN P_ECHO_TEXT CHARACTER(50)
)
DYNAMIC RESULT SETS 1
LANGUAGE SQL
NOT DETERMINISTIC
CALLED ON NULL INPUT
READS SQL DATA
INHERIT SPECIAL REGISTERS
pgm: begin
DECLARE c1 CURSOR WITH RETURN TO CALLER FOR
values(P_Echo_Text)
;
-- to return result set, do not CLOSE cursor
OPEN c1;
end
@
----------------------------------------
the statement i used to compile: db2 -td@ -vsf proc.sql
Aug 30 '06 #7
peteh wrote:
Raj-
Thanks so much for your help. I have gotten the compile to work. It
appears to be my lack of knowleddge of CLP/statement terminator
behavior and a misleading sqlcode that are the issues.
Let's fix this at the root.
At the very first line of your CLP script please add:
--#SET TERMINATOR @
Now all statements will be assumed completed when you type @:

CREATE TABLE T(c1 INT)@

CREATE PROCEDURE P(OUT a INT)
BEGIN
SET a = 5;
END@

.....
If you want to change the terminator back to ; just type:
--#SET TERMINATOR ;
Now you can use db2 -t <filename>

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Aug 30 '06 #8
Hi Serge;
Excellent! Thanks very much. Once again you have saved me from pulling
my (my ever-receding) hair out.

Pete H

Serge Rielau wrote:
peteh wrote:
Raj-
Thanks so much for your help. I have gotten the compile to work. It
appears to be my lack of knowleddge of CLP/statement terminator
behavior and a misleading sqlcode that are the issues.
Let's fix this at the root.
At the very first line of your CLP script please add:
--#SET TERMINATOR @
Now all statements will be assumed completed when you type @:

CREATE TABLE T(c1 INT)@

CREATE PROCEDURE P(OUT a INT)
BEGIN
SET a = 5;
END@

....
If you want to change the terminator back to ; just type:
--#SET TERMINATOR ;
Now you can use db2 -t <filename>

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Aug 30 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: MD | last post by:
I am trying to create a dynamic SQL statement to create a view. I have a stored procedure, which based on the parameters passed calls different stored procedures. Each of this sub stored procedure...
5
by: jorge | last post by:
I had just recently installed a new database with partitions. I realized that all of my previous Java UDFs failed to install on the new database. Basically, I got SQL0270N with Reason code 59. ...
3
by: jcgeorge | last post by:
I am getting this: RETCODE : ZRC=0x8B59000D=-1957101555=SQLKF_NOMEM_BUFFER_HEAP "No memory available in 'FCMBP Heap'" DIA8300C A memory heap error has occurred. and this FUNCTION: DB2 UDB,...
1
by: peteh | last post by:
Hi All; We have 2 open PMRs - one for AIX, one for DB2 relating to this problem, but I thought I'd see if I could make any progress in the group. We just upgraded a 4 node/36 processor...
2
by: bashanitwonline | last post by:
Hi All, I have DB2 8.1 on my system. I have created a procedure as follows. CREATE PROCEDURE DB2ER000.XYZ() LANGUAGE SQL BEGIN INSERT INTO DB2ER000.A ( C,D,E) VALUES (10,20,30); END It...
10
by: Hardy | last post by:
Hi gurus, I know many of you are very senior DBAs and experts from IBM internal, so I really want to know your advice on this basic topic. "why dpf?" usually there's a rumor, em, I believe it's...
2
by: Sam Durai | last post by:
In Information Center it says; "Restrictions on database partitions - The use of any features of the native XML data store will prevent future use of the database partitioning feature available...
2
by: 4.spam | last post by:
Hello, all. DB2 v9.5.1 ESE, Windows 2003 Server 64-bit, 4 CPU (8 cores) each, DPF environment. There are 2 DPF instances on the same set of 5 computers. One computer holds coordinator...
2
by: ArtF | last post by:
Folks Just a quick question. How many of you out there are on 9.5 UDB with DPF. If you are on DPF what version of UDB did you transition from to get to 9.5. Thanks. ART
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.