Pessoal,

Problema:
Uma estrutura para Clinte A que tem que se manter fixa em quantidade de campos e tipos dos campos e ‘outra’ estrutura com campos novos para Cliente B.

Solução:

[et_pb_dmb_code_snippet _builder_version=”4.0.6″ code=”4oCUIENyaWFjYW8gZGEgVGFiZWxhCgpjcmVhdGUgdGFibGUgdGVzdGUKKAogIGNhbXBvMSBpbnRlZ2VyLAogIGNhbXBvMiB2YXJjaGFyMigxMCksCiAgY2FtcG8zIGNoYXIoMSkKKTsKCi0tIENyaWFjYW8gZGEgVmlldwpjcmVhdGUgb3IgcmVwbGFjZSB2aWV3IHZ0ZXN0ZSBhcyBzZWxlY3QgKiBmcm9tIHRlc3RlOwoKLS0gSW5zZXJpciBvcyBkYWRvcyAtIENsaWVudGUgQQppbnNlcnQgaW50byB2dGVzdGUgKGNhbXBvMSwgY2FtcG8yLCBjYW1wbzMpIHZhbHVlcyAoMSwndGVzdGUxJywncycpOwppbnNlcnQgaW50byB2dGVzdGUgKGNhbXBvMSwgY2FtcG8yLCBjYW1wbzMpIHZhbHVlcyAoMiwndGVzdGUyJywnYScpOwppbnNlcnQgaW50byB2dGVzdGUgKGNhbXBvMSwgY2FtcG8yLCBjYW1wbzMpIHZhbHVlcyAoMywndGVzdGUzJywnYicpOwppbnNlcnQgaW50byB2dGVzdGUgKGNhbXBvMSwgY2FtcG8yLCBjYW1wbzMpIHZhbHVlcyAoNCwndGVzdGU0JywnYycpOwppbnNlcnQgaW50byB2dGVzdGUgKGNhbXBvMSwgY2FtcG8yLCBjYW1wbzMpIHZhbHVlcyAoNSwndGVzdGU1JywnZicpOwoKLS0gQ3JpYXIgaW5kaWNlCmNyZWF0ZSB1bmlxdWUgaW5kZXggdGVzdGVfaWR4IG9uIHRlc3RlKGNhbXBvMSk7CgotLSBUZXN0ZSBwYXJhIHZlciBhY2FvIGRvIGluZGljZQppbnNlcnQgaW50byB2dGVzdGUgKGNhbXBvMSwgY2FtcG8yLCBjYW1wbzMpIHZhbHVlcyAoNSwndGVzdGU1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50ZSBCCmFsdGVyIHRhYmxlIHRlc3RlIGFkZCBjYW1wbzQgaW50ZWdlcjsKCi0tIEluc2VyaXIgZGFkb3MgbmEgdmlldyBzZW0gYSBjb2x1bmEgbm92YSAtIENsaWVudGUgQQppbnNlcnQgaW50byB2dGVzdGUgKGNhbXBvMSwgY2FtcG8yLCBjYW1wbzMpIHZhbHVlcyAoNywndGVzdGU3JywncCcpOwoKLS0gSW5zZXJpciBkYWRvcyAtIENsaWVudGUgQgppbnNlcnQgaW50byB0ZXN0ZSAoY2FtcG8xLCBjYW1wbzIsIGNhbXBvMywgY2FtcG80KSB2YWx1ZXMgKDgsJ3Rlc3RlOCcsJ3gnLDI1KTsKCi0tIERhZG9zIGZpbmFpcyBkYSB2aWV3CnNlbGVjdCBjYW1wbzEsIGNhbXBvMiwgY2FtcG8zIGZyb20gdnRlc3RlOwoKY2FtcG8xICBjYW1wbzIgIGNhbXBvMwoxICAgICAgIHRlc3RlMSAgcwoyICAgICAgIHRlc3RlMiAgYQozICAgICAgIHRlc3RlMyAgYgo0ICAgICAgIHRlc3RlNCAgYwo1ICAgICAgIHRlc3RlNSAgZgo3ICAgICAgIHRlc3RlNyAgcAo4ICAgICAgIHRlc3RlOCAgeAoKLS0gRGFkb3MgZmluYWlzIGRhIHRhYmVsYQpzZWxlY3QgY2FtcG8xLCBjYW1wbzIsIGNhbXBvMywgY2FtcG80IGZyb20gdGVzdGU7CgpjYW1wbzEgIGNhbXBvMiAgY2FtcG8zICBjYW1wbzQKMSAgICAgICB0ZXN0ZTEgIHMKMiAgICAgICB0ZXN0ZTIgIGEKMyAgICAgICB0ZXN0ZTMgIGIKNCAgICAgICB0ZXN0ZTQgIGMKNSAgICAgICB0ZXN0ZTUgIGYKNyAgICAgICB0ZXN0ZTcgIHAKOCAgICAgICB0ZXN0ZTggIHggICAgICAgMjU=[/et_pb_dmb_code_snippet]

Objetivo:
Objetivo era mostrar que podemos ter view que pode receber inserção para atender Cliente A e estrutura nova de tabela para atender Cliente B (através de outras views, direto na tabela, procedures …).
Detalhe para inserir na view, ela tem que possuir campo NOVOS que PODEM SER NULOS e também campo NÃO NOLO mas com default definido que vai continuar inserindo normalmente.

Att,
capin