SHARE
TWEET

Untitled

a guest Jan 24th, 2020 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. INSERT INTO mcg_plano_conta_referencial_instituicao (id, codigo, instituicao, codigo_ecd) SELECT 10, '10', 'Secretaria da Receita Federal', '10' WHERE NOT EXISTS(select id from mcg_plano_conta_referencial_instituicao where codigo = '10');
  2. INSERT INTO mcg_plano_conta_referencial_instituicao (id, codigo, instituicao, codigo_ecd) SELECT 18, 'L100L300A', 'Receita Federal-Lucro Real-PJ em Geral', '1' WHERE NOT EXISTS(select id from mcg_plano_conta_referencial_instituicao where codigo = 'L100L300A');
  3. INSERT INTO mcg_plano_conta_referencial_instituicao (id, codigo, instituicao, codigo_ecd) SELECT 19, 'L100L300B', 'Receita Federal-Lucro Real-Financeiras', '3' WHERE NOT EXISTS(select id from mcg_plano_conta_referencial_instituicao where codigo = 'L100L300B');
  4. INSERT INTO mcg_plano_conta_referencial_instituicao (id, codigo, instituicao, codigo_ecd) SELECT 20, 'L100L300C', 'Receita Federal-Lucro Real-Seguradoras ou Entidades Abertas de Previdência Complementar', '4' WHERE NOT EXISTS(select id from mcg_plano_conta_referencial_instituicao where codigo = 'L100L300C');
  5. INSERT INTO mcg_plano_conta_referencial_instituicao (id, codigo, instituicao, codigo_ecd) SELECT 12, 'P100P150', 'Receita Federal-Lucro Presumido', '2' WHERE NOT EXISTS(select id from mcg_plano_conta_referencial_instituicao where codigo = 'P100P150');
  6. INSERT INTO mcg_plano_conta_referencial_instituicao (id, codigo, instituicao, codigo_ecd) SELECT 13, 'U100U150A', 'Receita Federal-Imunes e Isentas-Geral', '5' WHERE NOT EXISTS(select id from mcg_plano_conta_referencial_instituicao where codigo = 'U100U150A');
  7. INSERT INTO mcg_plano_conta_referencial_instituicao (id, codigo, instituicao, codigo_ecd) SELECT 14, 'U100U150B', 'Receita Federal-Imunes e Isentas-Associação de Poupança e Empréstimo', '6' WHERE NOT EXISTS(select id from mcg_plano_conta_referencial_instituicao where codigo = 'U100U150B');
  8. INSERT INTO mcg_plano_conta_referencial_instituicao (id, codigo, instituicao, codigo_ecd) SELECT 15, 'U100U150C', 'Receita Federal-Imunes e Isentas-Entidades Abertas de Previdência Complementar(Sem Fins Lucrativos)', '7' WHERE NOT EXISTS(select id from mcg_plano_conta_referencial_instituicao where codigo = 'U100U150C');
  9. INSERT INTO mcg_plano_conta_referencial_instituicao (id, codigo, instituicao, codigo_ecd) SELECT 16, 'U100U150D', 'Receita Federal-Imunes e Isentas-Entidades Fechadas de Previdência Complementar', '8' WHERE NOT EXISTS(select id from mcg_plano_conta_referencial_instituicao where codigo = 'U100U150D');
  10. INSERT INTO mcg_plano_conta_referencial_instituicao (id, codigo, instituicao, codigo_ecd) SELECT 17, 'U100U150E', 'Receita Federal-Imunes e Isentas-Partidos Políticos', '9' WHERE NOT EXISTS(select id from mcg_plano_conta_referencial_instituicao where codigo = 'U100U150E');
  11.  
  12.  
  13. UPDATE ger_grupo_plano_conta_padrao SET id_mcg_plano_conta_referencial_instituicao = (select id FROM mcg_plano_conta_referencial_instituicao WHERE codigo = '10') WHERE id = 9997;
  14. UPDATE ger_grupo_plano_conta_padrao SET id_mcg_plano_conta_referencial_instituicao = (select id FROM mcg_plano_conta_referencial_instituicao WHERE codigo = 'L100L300A') WHERE id = 9998;
  15. UPDATE ger_grupo_plano_conta_padrao SET id_mcg_plano_conta_referencial_instituicao = (select id FROM mcg_plano_conta_referencial_instituicao WHERE codigo = 'P100P150') WHERE id = 9999;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top