View previous topic :: View next topic
|
Author |
Message |
Satish5
New User
Joined: 12 Nov 2007 Posts: 38 Location: Texas, USA
|
|
|
|
Hi,
I am writing a stored procedure that will have a dynamic query. SELECT, FROM and WHERE part of query are static whereas ORDER BY part is dynamic.
PREPARE S1 FROM :STMT
When I execute the SP it abends with SQLCODE -311 (THE LENGTH OF INPUT HOST VARIABLE NUMBER position-number IS NEGATIVE OR GREATER THAN THE MAXIMUM)
I need to give 74 columns in SELECT and approximate length of query (moved to STMT) becomes 1500 characters.
Please suggest a solution.
Regards,
Satish |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
THE LENGTH OF INPUT HOST VARIABLE NUMBER position-number IS NEGATIVE OR GREATER THAN THE MAXIMUM) |
1500 bytes for an sql is nowhere near the limit and has nothing to do with your problem
position number provides you with the position of the host variable that is incorrectly defined.
also, search the db2 threads, there have been several -311 discussions. |
|
Back to top |
|
|
|