Fórum Retirar Espaço em Branco com Código na tabela ASCII #543168
20/01/2016
0
Wylliam
Curtir tópico
+ 0Post mais votado
20/01/2016
Select rtrim(ltrim(sua-var))
Jothaz
Gostei + 1
Mais Posts
21/01/2016
Wylliam
Gostei + 0
21/01/2016
Marcos P
Será que não é um outro carácter de controle ( TAB, por exemplo ) ?
Gostei + 1
21/01/2016
Wylliam
Gostei + 0
21/01/2016
Marcos P
vertical tab (VT) : CHAR(11)
http://www.theasciicode.com.ar/ascii-control-characters/horizontal-tab-ascii-code-9.html
Gostei + 1
21/01/2016
Wylliam
DECLARE
BEGIN
FOR i IN 0..255 LOOP
DBMS_OUTPUT.PUT_LINE('chr'||i|| ':' || chr(i));
END LOOP;
END;
[b]chr(0)
chr(1)
chr(9)
chr(10)
chr(11)
chr(12)
chr(13)
chr(32)
chr(160)[/b]
Então fiz essa função para resolver o problema de quando o trim não funciona:
CREATE OR REPLACE FUNCTION REMOVE_ESPACO(p_String IN VARCHAR2) RETURN VARCHAR2 IS BEGIN p_String:= REPLACE(p_String, chr(0), chr(32)); p_String:= REPLACE(p_String, chr(1), chr(32)); p_String:= REPLACE(p_String, chr(9), chr(32)); p_String:= REPLACE(p_String, chr(10), chr(32)); p_String:= REPLACE(p_String, chr(11), chr(32)); p_String:= REPLACE(p_String, chr(12), chr(32)); p_String:= REPLACE(p_String, chr(13), chr(32)); p_String:= REPLACE(p_String, chr(160), chr(32)); RETURN TRIM(p_String); END;
Obs: o chr(32) consegue ser removido com o TRIM.
Gostei + 0
22/01/2016
Fabiano Carvalho
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)