I have the following scenario: I have mysql server and defined multiple database and tables. the some fields of these tables I have text that includes the name of documents Example 1:
DocRel
CCTR0000007
example 2:
Memo
el documento CCTR0000007 fue cancelado
I am trying to do the following: There is some way to search and update in all places the text with the following search terms:
tamaño de string definido: ejemplo 'CCTR0000007' 11 caracteres
pattern de string definido: ejemplo 'CCTR0000007' todos los que comiencen con CCTR
and update the document by increasing the zeroes '0' example:
CCTR0000007
a:
CCTR00000000000007
why: why should I screw up thinking that the documentation should not be very broad and apparently already go through document CCTR0920008 and in a couple of months they will reach the numerical limit.
and the examples these like that do not work me very well:
UPDATE t1 SET NUMER=CONCAT('00000',NUMER) WHERE LENGTH(NUMER)=1;
UPDATE t1 SET NUMER=CONCAT('0000',NUMER) WHERE LENGTH(NUMER)=2;
UPDATE t1 SET NUMER=CONCAT('000',NUMER) WHERE LENGTH(NUMER)=3;
SELECT LPAD(NUMER,6,'0') AS NUMER
FROM ...