{"id":61,"date":"2007-01-07T14:03:07","date_gmt":"2007-01-07T13:03:07","guid":{"rendered":"http:\/\/bar-solutions.com\/wordpress\/?p=61"},"modified":"2007-01-07T14:03:50","modified_gmt":"2007-01-07T13:03:50","slug":"tabs-in-output","status":"publish","type":"post","link":"https:\/\/blog.bar-solutions.com\/?p=61","title":{"rendered":"Tabs in output"},"content":{"rendered":"<p>By default, when you press the tab-key in the editor, the indent is replaced by spaces. I wanted the generated code to contain tabs instead of spaces, so&nbsp;I have created the following code:<br \/> <strong>An Oracle Stored Function:<\/strong><\/p>\n<blockquote>\n<p>create or replace function tab_char return varchar2<br \/> is<br \/> begin<br \/> &nbsp; return chr(9);<br \/> end tab_char;<\/p>\n<\/blockquote>\n<p>In the cgml code I have created the following:<\/p>\n<blockquote>\n<p>[SETALIAS]_tab[TO]{tab_char}<\/p>\n<\/blockquote>\n<p>Now I can use the _tab variable to get my indents using the tab character:<\/p>\n<blockquote>\n<p>BEGIN<br \/> {_tab}DBMS_OUTPUT.PUT_LINE(&#39;source indented using tabs&#39;);<br \/> END;<\/p>\n<\/blockquote>\n<p>You can of course add more special characters this way and put the Oracle code in a package. Also, you can include the [SETALIAS] code in a setup script, so you have you special characters available at all times. And if you decide to change the name of the Oracle function, you only have to change a single call to this.<br \/> Also, don&#39;t forget to create synonyms and grant privileges if you want to use this function while generating from another schema.<br \/> Hope this is useful. Maybe we will see a CGML function for this in the future.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, when you press the tab-key in the editor, the indent is replaced by spaces. I wanted the generated code to contain tabs instead of spaces, so&nbsp;I have created the following code: An Oracle Stored Function: create or replace function tab_char return varchar2 is begin &nbsp; return chr(9); end tab_char; In the cgml code [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,5],"tags":[],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-codegen","category-plsql"],"_links":{"self":[{"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=\/wp\/v2\/posts\/61","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=61"}],"version-history":[{"count":0,"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bar-solutions.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}