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 > create a simple procedure failed.pls help me

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-05, 21:25
Metatron Metatron is offline
Registered User
 
Join Date: Feb 2004
Posts: 21
Question create a simple procedure failed.pls help me

hi,everyone.
yesterday,i run a script to create a procedure. but i got failed.
anyone can help me solve this problem.
From the message,May be the "catalog node"problem.
But something confuse me is that script i once got success.and my database is fine.nothing wrong with node.

Any Help will be appreciated.

Metatron.
################################################
db2 -td@ -vf getText.sql
CREATE PROCEDURE getTEXT (IN in_put smallint,OUT out_put smallint)
language sql
begin
select int(12/in_put) into out_put from sysibm.sysdummy1;
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:
SQL0901N The SQL statement failed because of a non-severe system error.
Subsequent SQL statements can be processed. (Reason "CREATE PROCEDURE with
LANGUAGE SQL only allowed at catalog node".) SQLSTATE=58004
#################################################

Last edited by Metatron; 01-13-05 at 21:36.
Reply With Quote
  #2 (permalink)  
Old 01-15-05, 08:15
Metatron Metatron is offline
Registered User
 
Join Date: Feb 2004
Posts: 21
who can help me ?

pls

Metatron.
Reply With Quote
  #3 (permalink)  
Old 01-15-05, 09:34
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Did you put a @ at the end of the source code? Should be right after the END statement (same line).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 01-16-05, 20:06
Metatron Metatron is offline
Registered User
 
Join Date: Feb 2004
Posts: 21
Question

Quote:
Originally Posted by Marcus_A
Did you put a @ at the end of the source code? Should be right after the END statement (same line).
First,Thank you for your reply.
of course i put a @ at the end of the code.
the content of getText.sql is
#####################################
CREATE PROCEDURE getTEXT (IN in_put smallint,OUT out_put smallint)
language sql
begin
select int(12/in_put) into out_put from sysibm.sysdummy1;
end@
#####################################
Actually,whatever my "create procedure" script is,i always get the message below
#####################################
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0901N The SQL statement failed because of a non-severe system error.
Subsequent SQL statements can be processed. (Reason "CREATE PROCEDURE with
LANGUAGE SQL only allowed at catalog node".) SQLSTATE=58004
#####################################
Is there something wrong with my database or db configure?

Last edited by Metatron; 01-16-05 at 20:12.
Reply With Quote
  #5 (permalink)  
Old 01-18-05, 07:40
achiola achiola is offline
Registered User
 
Join Date: May 2002
Location: General Deheza, Cba, Arg.
Posts: 273
Reply With Quote
  #6 (permalink)  
Old 01-18-05, 20:57
Metatron Metatron is offline
Registered User
 
Join Date: Feb 2004
Posts: 21
Smile

Quote:
Originally Posted by achiola
thank you achiola.
thank you for your reply.
i had already read that article before.it had nothing with my problem.
i can't get anything helps for my problem.

regards.
Metatron
Reply With Quote
  #7 (permalink)  
Old 01-19-05, 06:23
gardenman gardenman is offline
Registered User
 
Join Date: Apr 2004
Posts: 54
connect to test

Database Connection Information

Database server = DB2/NT 8.2.0
SQL authorization ID = DB2ADMIN
Local database alias = TEST


create procedure gettext (in in_put int,inout out_put int)
language sql
begin
values in_put*10 into out_put;
end

DB20000I The SQL command completed successfully.

call gettext(10,0)

Value of output parameters
--------------------------
Parameter Name : OUT_PUT
Parameter Value : 100

Return Status = 0


just change "out" to "inout", because clp does not have variable where to save result
Reply With Quote
  #8 (permalink)  
Old 01-20-05, 02:41
Metatron Metatron is offline
Registered User
 
Join Date: Feb 2004
Posts: 21
Unhappy

Quote:
Originally Posted by gardenman
connect to test

Database Connection Information

Database server = DB2/NT 8.2.0
SQL authorization ID = DB2ADMIN
Local database alias = TEST


create procedure gettext (in in_put int,inout out_put int)
language sql
begin
values in_put*10 into out_put;
end

DB20000I The SQL command completed successfully.

call gettext(10,0)

Value of output parameters
--------------------------
Parameter Name : OUT_PUT
Parameter Value : 100

Return Status = 0


just change "out" to "inout", because clp does not have variable where to save result
thanks gardenman.

sorry,but it seems to didn't work.
i got the same error.
#####################################
>db2 -td@ -vf getText.sql

create procedure gettext (in in_put int,inout out_put int)
language sql
begin
values in_put*10 into out_put;
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:
SQL0901N The SQL statement failed because of a non-severe system error.
Subsequent SQL statements can be processed. (Reason "CREATE PROCEDURE with
LANGUAGE SQL only allowed at catalog node".) SQLSTATE=58004
Reply With Quote
  #9 (permalink)  
Old 01-20-05, 03:21
gardenman gardenman is offline
Registered User
 
Join Date: Apr 2004
Posts: 54
db2 => ? SQL0901N


SQL0901N The SQL statement failed because of a non-severe system
error. Subsequent SQL statements can be processed.
(Reason "<reason>".)

Explanation:

An error has occurred which is due to a system error. Processing
of the SQL statement has ended for reason "<reason>" (this is in
English only and is useful only to IBM support personnel).

User Response:

Record the message number (SQLCODE) and reason "<reason>".

If trace was active, invoke the Independent Trace Facility at
the operating system command prompt. Then contact your technical
service representative with the following information:

o Problem description

o SQLCODE

o reason "<reason>"

o SQLCA contents if possible

o Trace file if possible.



Federated system users: isolate the problem to the data source
failing the request (refer to the problem determination guide to
determine which data source is failing to process the SQL
statement) and take the necessary diagnostic steps for that data
source. The problem determination procedures for data sources
vary, so refer to the applicable data source manuals.

sqlcode : -901

sqlstate : 58004
Sorry, I have not read your post carefully
Hmm...
I think your must pay attention to words "Federated system users:".
I don't know anything about your system environment...
Reply With Quote
  #10 (permalink)  
Old 01-20-05, 03:36
Metatron Metatron is offline
Registered User
 
Join Date: Feb 2004
Posts: 21
Unhappy

Quote:
Originally Posted by gardenman
db2 => ? SQL0901N


SQL0901N The SQL statement failed because of a non-severe system
error. Subsequent SQL statements can be processed.
(Reason "<reason>".)

Explanation:

An error has occurred which is due to a system error. Processing
of the SQL statement has ended for reason "<reason>" (this is in
English only and is useful only to IBM support personnel).

User Response:

Record the message number (SQLCODE) and reason "<reason>".

If trace was active, invoke the Independent Trace Facility at
the operating system command prompt. Then contact your technical
service representative with the following information:

o Problem description

o SQLCODE

o reason "<reason>"

o SQLCA contents if possible

o Trace file if possible.



Federated system users: isolate the problem to the data source
failing the request (refer to the problem determination guide to
determine which data source is failing to process the SQL
statement) and take the necessary diagnostic steps for that data
source. The problem determination procedures for data sources
vary, so refer to the applicable data source manuals.

sqlcode : -901

sqlstate : 58004
Sorry, I have not read your post carefully
Hmm...
I think your must pay attention to words "Federated system users:".
I don't know anything about your system environment...
thanks.
i'm not a Federated system user.
my database is on the aix os machine and my database version is ver7.1.
Reply With Quote
  #11 (permalink)  
Old 01-23-05, 20:13
Metatron Metatron is offline
Registered User
 
Join Date: Feb 2004
Posts: 21
Question

^_^
guys...
something strange!
in my database ,i have 8 node(0,1,2,3,4,5,6,7)
only on node0 i can run the script then get success.
on other nodes,whatever the content of script,i always get failed.
why can be this?!
someone knows?
Reply With Quote
  #12 (permalink)  
Old 01-23-05, 21:47
javierfrank javierfrank is offline
Registered User
 
Join Date: May 2004
Posts: 25
Hi Gardenman/Metatron:

I have a similar problem, with the difference that when I try to create my SP, it returns:

P3402646.c
P3402646.c(17) : error C2065: 'wchar_t' : undeclared identifier
P3402646.sqc(257) : error C2065: 'NULL' : undeclared identifier
P3402646.sqc(257) : error C2099: initializer is not a constant
P3402646.sqc(258) : error C2099: initializer is not a constant
P3402646.sqc(259) : error C2099: initializer is not a constant
P3402646.sqc(260) : error C2099: initializer is not a constant
P3402646.sqc(276) : error C2143: syntax error : missing ')' before 'type'
P3402646.sqc(282) : error C2143: syntax error : missing ')' before 'type'
P3402646.sqc(308) : warning C4047: '==' : 'struct _psm_CB *' differs in levels o
f indirection from 'int '
P3402646.sqc(386) : warning C4047: 'function' : 'struct sqla_setds_list *' diffe
rs in levels of indirection from 'int '...

Maybe you can help me....
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