{"id":472,"date":"2022-03-11T20:24:28","date_gmt":"2022-03-11T12:24:28","guid":{"rendered":"https:\/\/heoffice.com\/?p=472"},"modified":"2022-04-02T21:16:49","modified_gmt":"2022-04-02T13:16:49","slug":"mysql-and-oracle-sql","status":"publish","type":"post","link":"https:\/\/heoffice.com\/?p=472","title":{"rendered":"MySQL and Oracle SQL"},"content":{"rendered":"\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><thead><tr><th><\/th><th><\/th><th><\/th><\/tr><\/thead><tbody><tr><td>Desc<\/td><td>MySQL<\/td><td>Oracle<\/td><\/tr><tr><td>show create table<\/td><td>show create table  TABLE_NAME<\/td><td>select table_name,dbms_metadata.get_ddl(&#8216;TABLE&#8217;,&#8217;TABLE_NAME&#8217;)from dual,user_tables where table_name=&#8217;TABLE_NAME&#8217;;<\/td><\/tr><tr><td>select table <\/td><td><\/td><td>select * from dba_tables where table_name=&#8217;TABLE_NAME&#8217;<\/td><\/tr><tr><td>select db link<\/td><td><\/td><td>select&nbsp;*&nbsp;from&nbsp;user_db_links;<br>select&nbsp;*&nbsp;from&nbsp;dba_db_links;<\/td><\/tr><tr><td>create table when not exists<\/td><td><\/td><td><code>declare<br>\u00a0 already_exists \u00a0exception;<br>\u00a0 columns_indexed exception;<br>\u00a0 pragma exception_init( already_exists, -955 );<br>\u00a0 pragma exception_init(columns_indexed, -1408);<br>begin<br>\u00a0 execute immediate 'create table MAPPING_LINKS( SOURCE_ID NUMBER(10,0), LINK(10,0) )';<br>\u00a0 execute immediate 'create index IDX_MAPPING_LINKS_SOURCEID on MAPPING_LINKS (SOURCE_ID)'; \u00a0<br>\u00a0 dbms_output.put_line( 'created' );<br>exception<br>\u00a0 when already_exists or columns_indexed then<br>\u00a0 dbms_output.put_line( 'skipped' ); \u00a0<br>end;<br>\/<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Desc MySQL Oracle show create table show create table T&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[58,59],"tags":[],"class_list":["post-472","post","type-post","status-publish","format-standard","hentry","category-program","category-sql"],"acf":[],"_links":{"self":[{"href":"https:\/\/heoffice.com\/index.php?rest_route=\/wp\/v2\/posts\/472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/heoffice.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/heoffice.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/heoffice.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/heoffice.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=472"}],"version-history":[{"count":13,"href":"https:\/\/heoffice.com\/index.php?rest_route=\/wp\/v2\/posts\/472\/revisions"}],"predecessor-version":[{"id":580,"href":"https:\/\/heoffice.com\/index.php?rest_route=\/wp\/v2\/posts\/472\/revisions\/580"}],"wp:attachment":[{"href":"https:\/\/heoffice.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/heoffice.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/heoffice.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}