{"id":172,"date":"2007-08-31T14:14:56","date_gmt":"2007-08-31T13:14:56","guid":{"rendered":"http:\/\/bar-solutions.com\/wordpress\/?p=172"},"modified":"2007-08-31T14:14:56","modified_gmt":"2007-08-31T13:14:56","slug":"qda-on-tables","status":"publish","type":"post","link":"https:\/\/blog.bar-solutions.com\/?p=172","title":{"rendered":"QDA on tables&#8230;"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" style=\"border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px\" height=\"32\" alt=\"codegen\" src=\"http:\/\/bar-solutions.com\/wordpress\/wp-content\/codegen-icon.jpg\" width=\"32\" align=\"left\" border=\"0\"\/> When you are implementing the QDA in an existing application, you may want to know what tables have the QDA implemented and what tables don&#8217;t have it implemented yet.<\/p>\n<p>I have created two&nbsp;SQL statements that retrieve this information from the data dictionary.<\/p>\n<p><!--more--><\/p>\n<p>Tables <strong>with<\/strong> QDA packages present:<\/p>\n<div class=\"wlWriterSmartContent\" id=\"57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:a45cc984-e89f-49f4-af5a-c4fa9275034f\" contenteditable=\"false\" style=\"padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px\">\n<pre style=\"background-color:White;;overflow: auto;;font-family:Microsoft Sans Serif;font-size:9.75\"><div><!--\n\nCode highlighting produced by Actipro CodeHighlighter (freeware)\nhttp:\/\/www.CodeHighlighter.com\/\n\n--><span style=\"color: #0000FF; \">SELECT<\/span><span style=\"color: #000000; \"> uo.<\/span><span style=\"color: #FF00FF; \">object_name<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #0000FF; \">FROM<\/span><span style=\"color: #000000; \"> user_objects uo\n<\/span><span style=\"color: #0000FF; \">WHERE<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #000000; \">\n  <\/span><span style=\"color: #808080; \">AND<\/span><span style=\"color: #000000; \"> uo.object_type <\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #FF0000; \">TABLE<\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #000000; \">\n  <\/span><span style=\"color: #808080; \">AND<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #808080; \">EXISTS<\/span><span style=\"color: #000000; \"> (<\/span><span style=\"color: #0000FF; \">SELECT<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #000000; \">\n                <\/span><span style=\"color: #0000FF; \">FROM<\/span><span style=\"color: #000000; \"> user_objects uo2\n               <\/span><span style=\"color: #0000FF; \">WHERE<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #000000; \">\n                 <\/span><span style=\"color: #808080; \">AND<\/span><span style=\"color: #000000; \"> uo2.<\/span><span style=\"color: #FF00FF; \">object_name<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #000000; \"> uo.<\/span><span style=\"color: #FF00FF; \">object_name<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #808080; \">||<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #FF0000; \">_TP<\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #000000; \">\n                 <\/span><span style=\"color: #808080; \">AND<\/span><span style=\"color: #000000; \"> uo2.object_type <\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #FF0000; \">PACKAGE<\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #000000; \">\n             );<\/span><\/div><\/pre>\n<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http:\/\/dunnhq.com --><\/div>\n<p>Tables <strong>without<\/strong> QDA packages present:<\/p>\n<\/p>\n<div class=\"wlWriterSmartContent\" id=\"57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:de048b14-741f-44e6-bb47-a58fc70369fe\" contenteditable=\"false\" style=\"padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px\">\n<pre style=\"background-color:White;;overflow: auto;;font-family:Microsoft Sans Serif;font-size:9.75\"><div><!--\n\nCode highlighting produced by Actipro CodeHighlighter (freeware)\nhttp:\/\/www.CodeHighlighter.com\/\n\n--><span style=\"color: #0000FF; \">SELECT<\/span><span style=\"color: #000000; \"> uo.<\/span><span style=\"color: #FF00FF; \">object_name<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #0000FF; \">FROM<\/span><span style=\"color: #000000; \"> user_objects uo\n<\/span><span style=\"color: #0000FF; \">WHERE<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #000000; \">\n  <\/span><span style=\"color: #808080; \">AND<\/span><span style=\"color: #000000; \"> uo.object_type <\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #FF0000; \">TABLE<\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #000000; \">\n  <\/span><span style=\"color: #808080; \">AND<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #808080; \">NOT<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #808080; \">EXISTS<\/span><span style=\"color: #000000; \"> (<\/span><span style=\"color: #0000FF; \">SELECT<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #000000; \">\n                    <\/span><span style=\"color: #0000FF; \">FROM<\/span><span style=\"color: #000000; \"> user_objects uo2\n                   <\/span><span style=\"color: #0000FF; \">WHERE<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #000000; \">\n                     <\/span><span style=\"color: #808080; \">AND<\/span><span style=\"color: #000000; \"> uo2.<\/span><span style=\"color: #FF00FF; \">object_name<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #000000; \"> uo.<\/span><span style=\"color: #FF00FF; \">object_name<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #808080; \">||<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #FF0000; \">_TP<\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #000000; \">\n                     <\/span><span style=\"color: #808080; \">AND<\/span><span style=\"color: #000000; \"> uo2.object_type <\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #FF0000; \">PACKAGE<\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #000000; \">\n                 );<\/span><\/div><\/pre>\n<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http:\/\/dunnhq.com --><\/div>\n<\/p>\n<p>These queries can also be used to generate code again that already has the QDA in place or generate code for table that don&#8217;t yet have the QDA generated yet. In the run window select the object type you want (in this case &#8216;TABLE&#8217;) and in the <em>And Where (Freeform)<\/em> you put the following (sub) query.<em>&nbsp;<\/em><\/p>\n<\/p>\n<div class=\"wlWriterSmartContent\" id=\"57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:d56205f6-6bfe-47c8-bf74-743ecd6a0af8\" contenteditable=\"false\" style=\"padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px\">\n<pre style=\"background-color:White;;overflow: auto;;font-family:Microsoft Sans Serif;font-size:9.75\"><div><!--\n\nCode highlighting produced by Actipro CodeHighlighter (freeware)\nhttp:\/\/www.CodeHighlighter.com\/\n\n--><span style=\"color: #FF00FF; \">object_name<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #808080; \">IN<\/span><span style=\"color: #000000; \"> (\n<\/span><span style=\"color: #0000FF; \">SELECT<\/span><span style=\"color: #000000; \"> uo.<\/span><span style=\"color: #FF00FF; \">object_name<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #0000FF; \">FROM<\/span><span style=\"color: #000000; \"> user_objects uo\n<\/span><span style=\"color: #0000FF; \">WHERE<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #000000; \">\n  <\/span><span style=\"color: #808080; \">AND<\/span><span style=\"color: #000000; \"> uo.object_type <\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #FF0000; \">TABLE<\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #000000; \">\n  <\/span><span style=\"color: #808080; \">AND<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #808080; \">NOT<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #808080; \">EXISTS<\/span><span style=\"color: #000000; \"> (<\/span><span style=\"color: #0000FF; \">SELECT<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #000000; \">\n                    <\/span><span style=\"color: #0000FF; \">FROM<\/span><span style=\"color: #000000; \"> user_objects uo2\n                   <\/span><span style=\"color: #0000FF; \">WHERE<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #800000; font-weight: bold; \">1<\/span><span style=\"color: #000000; \">\n                     <\/span><span style=\"color: #808080; \">AND<\/span><span style=\"color: #000000; \"> uo2.<\/span><span style=\"color: #FF00FF; \">object_name<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #000000; \"> uo.<\/span><span style=\"color: #FF00FF; \">object_name<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #808080; \">||<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #FF0000; \">_TP<\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #000000; \">\n                     <\/span><span style=\"color: #808080; \">AND<\/span><span style=\"color: #000000; \"> uo2.object_type <\/span><span style=\"color: #808080; \">=<\/span><span style=\"color: #000000; \"> <\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #FF0000; \">PACKAGE<\/span><span style=\"color: #FF0000; \">'<\/span><span style=\"color: #000000; \">\n                 )\n               )\n<\/span><\/div><\/pre>\n<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http:\/\/dunnhq.com --><\/div>\n<\/p>\n<p><font size=\"1\">(If you want to regenerate code, then replace the <em>NOT EXISTS<\/em> by<em>&nbsp; EXISTS<\/em>.)<\/font><\/p>\n<p>The second tab of the run window then&nbsp;looks like this (image has been edited):<\/p>\n<p><em><a href=\"http:\/\/bar-solutions.com\/wordpress\/wp-content\/run-codegen-for-non-existant-qda.jpg\" atomicselection=\"true\"><img loading=\"lazy\" decoding=\"async\" style=\"border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px\" height=\"240\" alt=\"run_codegen_for_non_existant_qda\" src=\"http:\/\/bar-solutions.com\/wordpress\/wp-content\/run-codegen-for-non-existant-qda-thumb.jpg\" width=\"216\" border=\"0\"\/><\/a><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you are implementing the QDA in an existing application, you may want to know what tables have the QDA implemented and what tables don&#8217;t have it implemented yet. I have created two&nbsp;SQL statements that retrieve this information from the data dictionary.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,2,9],"tags":[],"class_list":["post-172","post","type-post","status-publish","format-standard","hentry","category-codegen","category-oracle","category-sql"],"_links":{"self":[{"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=\/wp\/v2\/posts\/172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=172"}],"version-history":[{"count":0,"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=\/wp\/v2\/posts\/172\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}