Update only one character in a column - Oracle

1

I have a column, where it is written R. TEST, I just need to make a correction leaving for STREET. TEST, how to make this change in the Oracle database.

    
asked by anonymous 18.07.2017 / 15:07

2 answers

1

The expression below will update all values of COLUMN where the value begins with R. :

UPDATE TABELA
SET    COLUNA = REPLACE(COLUNA,'R. ','RUA. ')
WHERE  COLUNA   LIKE 'R. %';
    
18.07.2017 / 15:15
1

Well, I do not know the DBA rules for your system, but this type of column name is not recommended.

If your question concerns the registration of the Address / Lougradouro column:

update table
    set [NomeDaColunaDeEndereco] = 'Rua Teste'
[WHERE id = x];

If your question concerns the column name:

alter table
   tabela
rename column
   [R.TESTE]  
TO
   RUATESTE;

I hope I have helped in some way.

    
18.07.2017 / 15:20