{"id":1546,"date":"2016-12-23T12:26:07","date_gmt":"2016-12-23T11:26:07","guid":{"rendered":"https:\/\/clemente.pamplona.name\/dba\/?p=1546"},"modified":"2016-12-23T12:26:07","modified_gmt":"2016-12-23T11:26:07","slug":"problemas-con-la-clausula-editionable-en-dbms_metadata-get_ddl","status":"publish","type":"post","link":"http:\/\/clemente.pamplona.name\/dba\/problemas-con-la-clausula-editionable-en-dbms_metadata-get_ddl\/","title":{"rendered":"Problemas con la clausula EDITIONABLE en DBMS_METADATA.GET_DDL"},"content":{"rendered":"<p>Una de las librer\u00edas mas \u00fatiles de Oracle para obtener c\u00f3digo de una base de datos es la librer\u00eda <b>DBMS_METADATA.GET_DDL<\/b>.<br \/>\nCon la  llegada de 12c tenemos la nueva funcionalidad de objetos  \u00abEDITIONABLE\/NONEDITIONABLE \u00bb , si usamos la librer\u00eda <b>DBMS_METADATA.GET_DDL<\/b>, el c\u00f3digo de aplicaci\u00f3n que nos generar\u00e1 incluir\u00e1 esta propiedad.<\/p>\n<p>Pero que pasar\u00eda al intentar ejecutarlo en otra base de datos 11g, si ejecutamos el c\u00f3digo <\/p>\n<pre>\r\nCREATE OR REPLACE EDITIONABLE PROCEDURE \"ESQUEMA\".\"PRUEBA\" (\r\n<\/pre>\n<p>Nos encontraremos con el error <\/p>\n<pre>\r\nERROR en l\u00ednea 1:\r\nORA-00922: falta la opci\u00f3n o no es v\u00e1lida\r\n<\/pre>\n<p>\u00bfComo mitigamos este error?<br \/>\nActualmente hacemos las llamadas de la forma<\/p>\n<pre>\r\nDBMS_METADATA.GET_DDL('${TIPO}','${OBJETO}','${ESQUEMA}')\r\n<\/pre>\n<p>Simplemente tendremos que poner un par\u00e1metro adicional de compatibilidad de c\u00f3digo ,fij\u00e1ndolo a la 11.2.0, que es la \u00faltima versi\u00f3n donde no est\u00e1 definido el EDITIONABLE en el c\u00f3digo <\/p>\n<pre>\r\nDBMS_METADATA.GET_DDL('${TIPO}','${OBJETO}','${ESQUEMA}','11.2.0')\r\n<\/pre>\n<p>Como siempre ,m\u00e1s informaci\u00f3n en soporte<\/p>\n<ul><b>Doc ID 2079143.1<\/b>How to Remove EDITIONABLE\/NONEDITIONABLE Clause when DBMS_METADATA.GET_DDL <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Una de las librer\u00edas mas \u00fatiles de Oracle para obtener c\u00f3digo de una base de datos es la librer\u00eda DBMS_METADATA.GET_DDL. Con la llegada de 12c tenemos la nueva funcionalidad de objetos \u00abEDITIONABLE\/NONEDITIONABLE \u00bb , si usamos la librer\u00eda DBMS_METADATA.GET_DDL, el &hellip; <a href=\"http:\/\/clemente.pamplona.name\/dba\/problemas-con-la-clausula-editionable-en-dbms_metadata-get_ddl\/\">Sigue leyendo <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,60,66,114],"tags":[176,701,703],"class_list":["post-1546","post","type-post","status-publish","format-standard","hentry","category-11g","category-12c","category-errores-ora","category-plsql","tag-dbms_metadata-get_ddl","tag-editionable","tag-ora-00922"],"_links":{"self":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts\/1546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/comments?post=1546"}],"version-history":[{"count":2,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts\/1546\/revisions"}],"predecessor-version":[{"id":1548,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts\/1546\/revisions\/1548"}],"wp:attachment":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/media?parent=1546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/categories?post=1546"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/tags?post=1546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}