{"id":664,"date":"2013-02-01T18:02:05","date_gmt":"2013-02-01T15:02:05","guid":{"rendered":"http:\/\/www.fatihacar.com\/blog\/?p=664"},"modified":"2013-02-01T18:05:56","modified_gmt":"2013-02-01T15:05:56","slug":"random-character-generator-in-oracle","status":"publish","type":"post","link":"http:\/\/www.fatihacar.com\/blog\/random-character-generator-in-oracle\/","title":{"rendered":"Random Character Generator in Oracle"},"content":{"rendered":"<p>Oracle dbms_random package can generate random characters in character, numeric or alphanumeric formats. <\/p>\n<p>dbms_random.value(Parameter, Value)<\/p>\n<ul>\n<li>U &#8211; Upper case<\/li>\n<li>L &#8211; Lower case<\/li>\n<li>A &#8211; Alphanumeric<\/li>\n<li>X &#8211; Alphanumeric with upper case alphabets.<\/li>\n<li>P &#8211; Printable characters only.<\/li>\n<\/ul>\n<p><strong>Create Random Characters<\/strong><\/p>\n<blockquote><p>\nSQL> select dbms_random.random value from dual;<br \/>\nValue : 531879542<\/p>\n<p>SQL> select dbms_random.value from dual;<br \/>\nValue : 1<\/p>\n<p>SQL> select dbms_random.value(100,1000) valuefrom dual;<br \/>\nValue : 452<\/p>\n<p>SQL> select dbms_random.value(100000000000, 999999999999) value from dual;<br \/>\nValue : 515055428760<\/p>\n<p>SQL> select dbms_random.string(&#8216;U&#8217;, 10) str from dual;<br \/>\nValue : KGSQLEKTSX<\/p>\n<p>SQL> select dbms_random.string(&#8216;L&#8217;, 10) str from dual;<br \/>\nValue = ksfkwqwerv<\/p>\n<p>SQL> select dbms_random.string(&#8216;A&#8217;, 10) str from dual;<br \/>\nValue : RhjE+RojjL<\/p>\n<p>SQL> select dbms_random.string(&#8216;X&#8217;, 10) str from dual;<br \/>\nValue : GF:E3B4GRB<\/p>\n<p>SQL> select dbms_random.string(&#8216;P&#8217;, 10) str from dual;<br \/>\nValue : *Yw(IK\/zsj\n<\/p><\/blockquote>\n<p><!--more--><br \/>\nDBMS_RANDOM is a good utility and will find its way into lot of development projects, especially web based ones. However, this Package is not exhaustively documented. One should not use it just for the sake of it being there. Make sure that there is a true requirement or a necessity of random values before making use of this package. If you already have a custom code meant for the same purpose, check out the benefits that are available when using this package compared to your application.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oracle dbms_random package can generate random characters in character, numeric or alphanumeric formats. dbms_random.value(Parameter, Value) U &#8211; Upper case L &#8211; Lower case A &#8211; Alphanumeric X &#8211; Alphanumeric with upper case alphabets. P &#8211; Printable characters only. Create Random Characters SQL> select dbms_random.random value from dual; Value : 531879542 SQL> select dbms_random.value from dual;&#8230;<\/p>\n","protected":false},"author":37,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12,6],"tags":[14,90,32],"class_list":["post-664","post","type-post","status-publish","format-standard","hentry","category-oracle-procedure","category-oracle-sql","tag-database-administration","tag-oracle","tag-oracle-administration"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p39NFI-aI","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/comments?post=664"}],"version-history":[{"count":6,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/664\/revisions"}],"predecessor-version":[{"id":670,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/664\/revisions\/670"}],"wp:attachment":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/media?parent=664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/categories?post=664"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/tags?post=664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}