{"id":92,"date":"2020-10-15T12:07:26","date_gmt":"2020-10-15T12:07:26","guid":{"rendered":"https:\/\/maboc.nl\/?p=92"},"modified":"2020-10-15T12:07:26","modified_gmt":"2020-10-15T12:07:26","slug":"creating-a-demotable","status":"publish","type":"post","link":"https:\/\/maboc.nl\/?p=92","title":{"rendered":"Creating a (demo)table"},"content":{"rendered":"\n<p>Often I need to create a table just for demonstration puposes, and this table needs to be filled up with data. The question for this post is&#8230;..: How to generate rows, preferrably a distinct number.<\/p>\n\n\n\n<p>So what I do? If the table has to be created yet:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create table &lt;table_name> as \n  with &lt;generator_name> as (select rownum l from dual connect by level&lt; &lt;number of rows>)\n  select &#91;l &lt;column_name>,....]  from &lt;generator_name>;<\/code><\/pre>\n\n\n\n<p>Or if the table allready exists:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>insert into &lt;table> \n  with engine as (select rownum l from dual connect by level &lt; &lt;number of rows>)\n  select &#91;&lt;column>,....] from engine; <\/code><\/pre>\n\n\n\n<p>Did I think of this myself&#8230;.no&#8230;.I&#8217;m not that inventive. I &#8220;borrowed&#8221; this method from <a href=\"https:\/\/jonathanlewis.wordpress.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Jonathan Lewis<\/a><\/p>\n\n\n\n<p>If you generate (demo) tables in a differrent way&#8230;please show me. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often I need to create a table just for demonstration puposes, and this table needs to be filled up with data. The question for this post is&#8230;..: How to generate rows, preferrably a distinct number. So what I do? If the table has to be created yet: Or if the table allready exists: Did I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[14],"class_list":["post-92","post","type-post","status-publish","format-standard","hentry","category-oracle","tag-sql"],"_links":{"self":[{"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/posts\/92","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/maboc.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=92"}],"version-history":[{"count":2,"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/posts\/92\/revisions"}],"predecessor-version":[{"id":95,"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/posts\/92\/revisions\/95"}],"wp:attachment":[{"href":"https:\/\/maboc.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=92"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/maboc.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=92"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/maboc.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=92"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}