1
In the Oracle database, I have the table (Tab_plavei) with the string field (Plavei), format UU9999. I need to adjust this field to the new standard of Mercosur boards, format UU9U99.
I’d like to execute a command SQL
to fix all cards that have already been registered in the format UU9999 changing to the new format UU9U99, that is, change the 2nd numeric character or 5º of the string, according to the standard table of Mercosul board, as below:
Old plate Mercosur Plate
0 A
1 B
2 C
3 D
4 and
5 F
6 G
7 H
8 I
9 J
You can help me make the right command to resolve this situation?
Give a read on the functions Charindex() and Substring()
– Ronaldo Araújo Alves
But after all, which is the database manager: mysql, oracle or sql server?
– José Diz
I will use in oracle, but the suggestion can be in any one, if you prefer oracle
– Mauri
It is important to clearly define the DB used, because the solution varies according to the engine. There you can use to post what you tried, in the form of [mcve], describing the difficulty. If you simply want to know how to insert a character within a string, you can simplify the question by removing all the superfluous information from the reason you are doing this, making possible solutions compatible with the website model (question about objective problem, useful answers for a wide range of users, which is compromised by the specificity of the plates).
– Bacco
I edited the question with more details, thanks for the comment!
– Mauri