CREATE OR ALTER VIEW TBCLIENTE(
    RAZAOSOCIAL,
    CODIGO,
    REPRESENTANTE_CODIGO,
    SUFRAMA,
    OBSERVACAO)
AS

select

 c.razaosocial RAZAOSOCIAL
 ,s.id CODIGO
 ,c.representante_id as REPRESENTANTE_CODIGO
 ,fn_remover(s.suframa) as suframa
 ,s.obs||ASCII_CHAR(13)||ASCII_CHAR(13)||
 s.obs_fat||ASCII_CHAR(13)||ASCII_CHAR(13)||
 s.obs_cli_pedido||ASCII_CHAR(13)||ASCII_CHAR(13)||
 s.obs_cli_prefat||ASCII_CHAR(13)||ASCII_CHAR(13)||
 s.obs_cli_fat||ASCII_CHAR(13)||ASCII_CHAR(13)||
 s.obs_consulta_cred as OBSERVACAO

from CLIENTES s, TBEMPRESA_C c
where c.codigo = s.id

;
