473,789 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_E CHO_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_T ext)
;
-- 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 4921
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_t est_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_t est_proc.ddl

CREATE PROCEDURE DVLXTRCT_TEST_E CHO_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_T ext)@
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_E CHO_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_T ext)
;
-- 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_E CHO_SP2
;
CREATE PROCEDURE DVLXTRCT_TEST_E CHO_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_T ext)
;
-- to return result set, do not CLOSE cursor
OPEN c1;
end;

GRANT EXECUTE ON PROCEDURE DVLXTRCT_TEST_E CHO_SP2 TO PUBLIC
@

When I do, I get the following:
--db2 -td@ -vsf dvlxtrct.pete_t est_proc.ddl
GRANT EXECUTE ON PROCEDURE DVLXTRCT_TEST_E CHO_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_E CHO_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_E CHO_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_T ext)
;
-- 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
8102
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 creates a string of custom SQL statement and returns this string back to the main stored procedure. This SQL statements work fine on there own. The SQL returned from the sub stored procedure are returned fine. The datatype of the variable that...
5
2154
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. I read up on the documentation, and found out that I can't have SQL in my Java UDFs and Stored procedures anymore? Is that really true?!?
3
2393
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, fast comm manager, sqlkfResrcFreeMemCheck, probe:100 MESSAGE : Shared mem. set is not big enough for more FCM buffers. Cur size: 297598976, Max size: 320307200, Needed size: 437059584
1
1787
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 configuration to AIX 5.2. We are at DB2 v8.1 (FP 5). We upgraded AIX one node at a time and began seeing periodic SQLCode -1225 and swapping issues. All nodes are now upgraded and we get more and more bouts where processes end in sqlcode -1225. Clearly,...
2
9271
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 got created. But While calling the procedure using the statement
10
10305
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 a rumor, that DPF can help you get greater performance, so even only one server, many IBM presales will sell DPF feature with the performance story. DPF license is not a cheap one:) I believe DPF is much more for scalability than performance.
2
1656
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 with DB2 Enterprise Server Edition. - An XML column or XML schema repository (XSR) object cannot be defined in a table of a database with more than one database partition defined. - If a database is defined with a single database partition and...
2
2399
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 partitions and other 4 hold partitioned tables (2 logical nodes per computer). Application: DataStage v8 running some (say 32) parallel massive single row inserts
2
1665
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
0
9659
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9504
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10400
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9977
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5413
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3692
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2903
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.