Tabela N31

Municípios
11camposNome físicoN31010(empresa 01)

Campos da tabela N31

11 campos no dicionário de dados do TOTVS Protheus.

11
CampoDescrição
N31_FILIAL
Caractere (C)(2)
Filial
N31_CDSUS
Caractere (C)(6)
Codigo SUS
Máscara:
999999
Contexto:
Real
Validação:
ExistChav("N31")
N31_CDIBGE
Caractere (C)(7)
Codigo IBGE
Máscara:
9999999
Contexto:
Real
N31_DESC
Caractere (C)(40)
Municipio
Máscara:
@!
Contexto:
Real
N31_DDD
Caractere (C)(3)
Codigo DDD
Máscara:
999
Contexto:
Real
N31_CEP
Caractere (C)(8)
Cep Inicial
Máscara:
@R 99999-999
Contexto:
Real
N31_CEP2
Caractere (C)(8)
Cep Final
Máscara:
@R 99999-999
Contexto:
Real
N31_UF
Caractere (C)(2)
UF
Máscara:
@!
Contexto:
Real
Consulta F3:
12
Validação:
ExistCpo("SX5","12"+M->N31_UF)
N31_REGIAO
Caractere (C)(3)
Regiao
Máscara:
@!
Contexto:
Real
N31_REGLOJ
Caractere (C)(1)
Regiao Loja
Máscara:
!
Contexto:
Real
Validação:
Pertence("01")
2 valores possíveis
  • 0Nao
  • 1Sim
N31_REGEMP
Caractere (C)(1)
Reg. Empresa
Máscara:
9
Contexto:
Real
Validação:
PERTENCE("01")
2 valores possíveis
  • 0Nao
  • 1Sim

SELECT de exemplo da tabela N31

No Protheus a tabela física leva o código da empresa (01 → 010) e registros excluídos ficam com D_E_L_E_T_ = '*'.

SQL · SQL Server
SELECT TOP 100
  N31.N31_FILIAL,
  N31.N31_CDSUS,
  N31.N31_CDIBGE,
  N31.N31_DESC,
  N31.N31_DDD,
  N31.N31_CEP,
  N31.N31_CEP2,
  N31.N31_UF
FROM N31010 N31
WHERE N31.D_E_L_E_T_ = ' '

Tabelas próximas no índice do Protheus

O ERPSeeker é um projeto independente, sem vínculo com a TOTVS. A estrutura pode variar conforme a versão e as customizações do seu ambiente.