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 calling procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-30-10, 11:37
crazycrazy crazycrazy is offline
Registered User
 
Join Date: Jan 2010
Posts: 6
Error calling procedure

Hi I am trying to call procedure and getting this error while calling it.

There was a problem getting a list: code: -408 SQLState: 42821 Message: DB2 SQL error: SQLCODE: -408, SQLSTATE: 42821, SQLERRMC: STR

where my procedure definition is like :
Create Procedure TESTPROC(IN str date,IN stro date)

SQLERRMC: STR is referring to parameter 1 of the procedure.

Can you please tell me what is wrong

I am calling procedure like this
CALL TESTPROC(param1,param2);
Reply With Quote
  #2 (permalink)  
Old 01-30-10, 11:53
tonkuma tonkuma is online now
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
Is there any statement like this?
SET str = ..... ;

You can't set str, because str is defined as IN.
Reply With Quote
  #3 (permalink)  
Old 01-30-10, 12:02
crazycrazy crazycrazy is offline
Registered User
 
Join Date: Jan 2010
Posts: 6
No TONKUMA

THERE IS NO SUCH STATEMENT WHICH TRIES TO SET THE VALUE of STR;
Is it something like parameter datatypes are not matching or something?

Also in DB2 whenever I write this,
Create Procedure TESTPROC(IN str VARCHAR,IN stro VARCHAR);
it also gives me error saying DB2ADMIN.VARCHAR is an undefined name. Any idea why this would occur?
Reply With Quote
  #4 (permalink)  
Old 01-30-10, 12:19
tonkuma tonkuma is online now
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
Quote:
I am calling procedure like this
CALL TESTPROC(param1,param2);
What are the data types of param1 and param2?

You shoud specify length for VARCHAR, like...
VARCHAR ( integer )

Anyway, be careful for matching of datatypes.
Reply With Quote
  #5 (permalink)  
Old 01-30-10, 13:19
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
The error -408 is for message SQL0408, which reads (according to the manual):
Quote:
SQL0408N A value is not compatible with the data type of its assignment
target. Target name is "<name>".

Explanation:

The data type of the value to be assigned to the column, parameter, SQL
variable, or transition variable by the SQL statement is incompatible
with the declared data type of the assignment target. Both must be:
* Numeric
* Character
* Graphic
* Dates or character
* Times or character
* Timestamps or character
* Datalinks
* The same distinct types
* Reference types where the target type of the value is a subtype of
the target type of the column.
* The same user-defined structured types. Or, the static type of the
value must be a subtype of the static type (declared type) of the
target. If a host variable is involved, the associated built-in type
of the host variable must be compatible with the parameter of the TO
SQL transform function defined in the transform group for the
statement.

The statement cannot be processed.

User response:

Examine the statement and possibly the target table or view to determine
the target data type. Ensure the variable, expression, or literal value
assigned has the proper data type for the assignment target. For a
user-defined structured type, also consider the parameter of the TO SQL
transform function defined in the transform group for the statement as
an assignment target.

sqlcode: -408

sqlstate: 42821
So you should check your stored procedure code where the problem may reside. Since you haven't shown us the code, we can't help you with that.
__________________
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