dbTalk Databases Forums  

Invalid length parameter with value of -4 passed to the substringfunction. in ASE 15 server

sybase.public.ase.general sybase.public.ase.general


Discuss Invalid length parameter with value of -4 passed to the substringfunction. in ASE 15 server in the sybase.public.ase.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Minch
 
Posts: n/a

Default Invalid length parameter with value of -4 passed to the substringfunction. in ASE 15 server - 06-04-2011 , 05:29 AM






Dear All,

Below query returning error. but, same query executes successfully in
other 2 servers with out error.

Adaptive Server Enterprise/15.0.3/EBF 17775 ESD#4/P/RS6000/AIX 5.3/
ase1503/2768/64-bit/FBO/Thu Aug 26 07:36:52 2010


What is reason?

QUERY:
---------------------
declare @tbl_name varchar(30)
select @tbl_name = 'expoparameters'
SELECT left(c.name, 20),
len(ltrim(rtrim(c.name))) - len('_module_id'),
left(ltrim(rtrim(c.name)), (len(ltrim(rtrim(c.name))) -
len('_module_id'))),
left(@tbl_name, len(left(c.name, (len(ltrim(rtrim(c.name))) -
len('_module_id')))))
FROM syscolumns c, sysobjects o
WHERE o.type = 'U'
AND o.name = @tbl_name
AND o.id = c.id
AND right(c.name,10) = '_module_id'
AND exists(SELECT 1 from modules m WHERE m.module_id = left(c.name,
(len(ltrim(rtrim(c.name))) - len('_module_id'))))
/* The following two lines are giving error, which are selected above
*/
AND left(c.name, (len(ltrim(rtrim(c.name))) - len('_module_id'))) =
left(@tbl_name, len(left(c.name, (len(ltrim(rtrim(c.name))) -
len('_module_id')))))
================================================== =======================
one server RESULT:

(1 row affected)
Msg 536, Level 16, State 4:
Server 'CBSPRCLI', Line 3:
Invalid length parameter with value of -4 passed to the substring
function.
================================================== =======================
Other server Results:

(1 row affected)

-------------------- -----------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------
expo_module_id 4
expo
expo

(1 row affected)
================================================== =======================

Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.