{"id":18057,"date":"2019-03-22T16:08:01","date_gmt":"2019-03-22T19:08:01","guid":{"rendered":"https:\/\/orabr.com\/?p=18057"},"modified":"2019-03-25T15:43:24","modified_gmt":"2019-03-25T18:43:24","slug":"oracle-ebs-apps-copiar-concorrente-de-uma-base-para-outra-via-pl-sql","status":"publish","type":"post","link":"https:\/\/orabr.virttus.com\/?p=18057","title":{"rendered":"[Oracle EBS\/APPS] COPIAR CONCORRENTE DE UMA BASE PARA OUTRA VIA PL\/SQL"},"content":{"rendered":"<HTML><HTML>\n<pre class=\"wp-block-code\"><code>--add concurrent via backend\nBEGIN\n  FOR C IN (\n   SELECT   DISTINCT \n            bFEV.User_Executable_Name\n           ,bFEV.executable_name\n           ,bFEV.description description_exe\n           ,bFEV.execution_file_name\n           ,fcpt.description description_pro\n           ,fcpt.user_concurrent_program_name\n           ,fcp.concurrent_program_name\n          ,(SELECT MEANING\n              FROM fnd_lookup_values\n             WHERE lookup_type   = 'CP_EXECUTION_METHOD_CODE'\n               AND enabled_flag  = 'Y'\n               AND LANGUAGE      = 'PTB'\n               AND lookup_code   = 'I') execution_method\n           ,fapp.application_short_name\n           ,fapt.application_name\n           ,rq.request_group_name\n           ,fcpt.language\n      FROM apps.fnd_concurrent_programs\/*DBLINK_ORIGEM*\/     fcp\n           ,apps.fnd_concurrent_programs_tl\/*DBLINK_ORIGEM*\/ fcpt\n           ,apps.fnd_executables\/*DBLINK_ORIGEM*\/            fe\n           ,apps.fnd_executables_tl\/*DBLINK_ORIGEM*\/         fet\n           ,fnd_concurrent_programs_vl\/*DBLINK_ORIGEM*\/      aFCP\n           ,fnd_executables_vl\/*DBLINK_ORIGEM*\/              bFEV\n           ,fnd_application\/*DBLINK_ORIGEM*\/                 fapp\n           ,fnd_application_tl\/*DBLINK_ORIGEM*\/              fapt\n           ,(\n               SELECT frg.request_group_name\n                     ,fcpt.user_concurrent_program_name\n                 FROM fnd_request_groups\/*DBLINK_ORIGEM*\/         frg\n                     ,fnd_request_group_units\/*DBLINK_ORIGEM*\/    frgu\n                     ,fnd_concurrent_programs\/*DBLINK_ORIGEM*\/    fcp\n                     ,fnd_concurrent_programs_tl\/*DBLINK_ORIGEM*\/ fcpt\n                     ,fnd_responsibility_tl\/*DBLINK_ORIGEM*\/      frt\n                     ,fnd_responsibility\/*DBLINK_ORIGEM*\/         frs\n               WHERE frgu.unit_application_id  = fcp.application_id\n                 AND frgu.request_unit_id      = fcp.concurrent_program_id\n                 AND frg.request_group_id      = frgu.request_group_id\n                 AND frg.application_id        = frgu.application_id\n                 AND fcp.application_id        = fcpt.application_id\n                 AND fcp.concurrent_program_id = fcpt.concurrent_program_id\n                 AND frs.application_id        = frt.application_id\n                 AND frs.responsibility_id     = frt.responsibility_id\n                 AND frs.request_group_id      = frg.request_group_id\n                 AND frs.application_id        = frg.application_id\n                 AND frt.language              = 'PTB'\n            ) RQ\n     WHERE fe.executable_id                = fet.executable_id\n       AND fcp.concurrent_program_id       = fcpt.concurrent_program_id\n       AND fcpt.language                   = fet.language\n       AND fcp.executable_id               = fe.executable_id\n       AND fcp.executable_application_id   = fe.application_id\n       AND fcpt.language                   = 'PTB'\n       AND aFCP.executable_id              = bFEV.executable_id\n       AND aFCP.ENABLED_FLAG               = 'Y'\n       AND aFCP.CONCURRENT_PROGRAM_ID      = fcpt.concurrent_program_id\n       AND fapp.application_id             = fcp.application_id\n       AND fapp.application_id             = fapt.application_id\n       AND RQ.user_concurrent_program_name = fcpt.user_concurrent_program_name\n       AND bFEV.execution_file_name     like 'XXX_XXXX_SYNC_TABLES_PK%' --NOME DA PACKAGE OU PROCEDURE\n   )\n  LOOP\n    BEGIN--CRIA EXECUT\u00c1VEL\n      FND_PROGRAM.executable(executable            => c.user_executable_name     -- Executable Name\n                            ,application           => c.application_short_name   -- Application Short Name\n                            ,short_name            => c.executable_name          -- Executable Short Name\n                            ,description           => c.description_EXE          -- Description,DEFAULT NULL\n                            ,execution_method      => c.execution_method         -- Execution Method\n                            ,execution_file_name   => c.execution_file_name      -- Execution File Name,DEFAULT NULL\n                            ,subroutine_name       => NULL                       -- Subroutine Name,DEFAULT NULL\n                            ,icon_name             => NULL                       -- Icon Name,DEFAULT NULL\n                            ,language_code         => c.language                 -- Language Code,DEFAULT 'US'\n                            ,execution_file_path   => NULL);                     -- Execution File Path, DEFAULT NULL\n  EXCEPTION\n    WHEN OTHERS THEN\n      NULL;\n  END;\n  --\n  BEGIN--CRIA CONCORRENTE\n    FND_PROGRAM.register(program                => c.user_concurrent_program_name-- CP Name\n                        ,application            => c.application_short_name      -- Application Short Name\n                        ,enabled                => 'Y'                           -- Flag to Enable\/Disable a CP\n                        ,short_name             => c.concurrent_program_name     -- CP Short Name\n                        ,description            => c.description_pro             -- Description,DEFAULT NULL\n                        ,executable_short_name  => c.executable_name             -- Executable Short Name\n                        ,executable_application => c.application_short_name      -- Executable Application Short Name\n                        ,save_output            => 'Y'                           -- Save Output,DEFAULT 'Y',\n                        ,print                  => 'Y'                           -- Print,DEFAULT 'Y',\n                        ,style_required         => 'N'                           -- DEFAULT 'N',\n                        ,use_in_srs             => 'Y'                           -- DEFAULT 'N',\n                        ,allow_disabled_values  => 'N'                           -- DEFAULT 'N',\n                        ,run_alone              => 'N'                           -- DEFAULT 'N',\n                        ,output_type            => 'TEXT'                        -- DEFAULT 'TEXT'\n                        ,enable_trace           => 'N'                           -- DEFAULT 'N',\n                        ,restart                => 'Y'                           -- DEFAULT 'Y',\n                        ,nls_compliant          => 'Y'                           -- DEFAULT 'Y',\n                        ,language_code          => c.language);                  -- DEFAULT 'US',        \n  EXCEPTION\n    WHEN OTHERS THEN\n      NULL;\n  END;\n  BEGIN--ASSOCIA COCORRENTE AO GRUPO DE SOLICITA\u00c7\u00c3O\n    apps.fnd_program.add_to_group (program_short_name    => c.concurrent_program_name\n                                  ,program_application   => c.application_name\n                                  ,request_group         => c.request_group_name\n                                  ,group_application     => c.application_name);\n  EXCEPTION\n    WHEN OTHERS THEN\n      NULL;\n  END;\n END LOOP; \n COMMIT;\nEND;<\/code><\/pre>\n<\/HTML><\/HTML>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,127,124,138],"tags":[],"class_list":["post-18057","post","type-post","status-publish","format-standard","hentry","category-base-de-conhecimentos","category-applications","category-database","category-sql"],"_links":{"self":[{"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=\/wp\/v2\/posts\/18057","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18057"}],"version-history":[{"count":5,"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=\/wp\/v2\/posts\/18057\/revisions"}],"predecessor-version":[{"id":18068,"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=\/wp\/v2\/posts\/18057\/revisions\/18068"}],"wp:attachment":[{"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}