sql - SQLCode=-138 flagging on large count tables but not small DB2 -


i built view in i'm using following code pull last name field formatted 'lastname,firstname':

value(rtrim(substr(a.previous_names,1,locate(',', a.previous_names)-1)), '')  "previous_name",                                                          

this view worked fine working in our sandbox environment, moved test, , try open view in dbvisualizer, data results provide error:

the second or third argument of substr or substring function out of  range. sqlcode=-138, sqlstate=22011, driver=4.22.29 

the sandbox has under 11k records, test , prod systems closer 1.2 million, i'm guessing performance issue result of complexity of piece of code. view still appears have been created, can query , return specific result/set of results, guess i'm concerned on if usable large query, or if performance concern in case?

is there better way can parse last name without having use substring on locate function?

thanks help!

most not performance issue, rows have data no comma


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -