All Forums General
Vinay151 20 posts Joined 12/14
16 Apr 2015
Is it possible to do arithmetic operations inside SUBSTR?

Hi,
    In my Teradata script, I'm using SUBSTR(columnname,1,(character_length(columnname)-4)). But, I'm getting the error as "2662   SUBSTR: string subscript out of bounds." Please help me on this.
 
 
Thanks,
Vinay.

Glass 225 posts Joined 04/10
16 Apr 2015

Vinay,
Yes you can but in this case I suspect columnname has values less than 4 chars which would produce this error.
 
Rglass

You must sign in to leave a comment.