<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5273779003508186345</id><updated>2011-12-13T00:25:51.292-08:00</updated><category term='forms'/><category term='apex'/><category term='javascript'/><category term='11g'/><title type='text'>unclechrisblog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-3521435171770994487</id><published>2011-07-24T10:19:00.000-07:00</published><updated>2011-12-13T00:25:51.341-08:00</updated><title type='text'>Closures in PL/SQL</title><content type='html'>Yesterday I read a few chapters of Conrad Barski's wonderful &lt;a href="http://landoflisp.com/"&gt;Land of Lisp&lt;/a&gt;. I nearly finished it months ago, but with the new job in the APEX team there was little time. While I love Lisp, PL/SQL is my main language and I sometimes miss the expressiveness of other languages - see Meta-PL/SQL. Well, if there is a will, there is a way, so I built me some closures. Compared to Lisp, the concept does not map naturally to PL/SQL and the implementation is only a toy. Anyway, here are a few examples:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;declare&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; l lambda := lambda('begin :r := :a + :b; end;',&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'b',1);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; dbms_output.put_line(l.exec('a',3)); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; dbms_output.put_line(l.exec('a',9));&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; l.close;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;end;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;4&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;10&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;PL/SQL procedure successfully completed.&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Map and reduce are popular patterns. Here's reduce:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;declare&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; type v2_tbl is table of varchar2(32767);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; function reduce (&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; l in lambda,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; t in v2_tbl,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; v in varchar2)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; return varchar2&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; is&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; l_result varchar2(32767) := v;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; begin&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; if t is not null then&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for i in 1 .. t.count loop&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; l_result := l.exec(&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'a',t(i),&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'b',l_result);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end loop;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; end if;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; l.close;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; return l_result;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; end;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; dbms_output.put_line (&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; reduce (&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; lambda(q'{begin&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dbms_output.put_line('adding '||:a||' to '||:b);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; :r := :a+:b;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end;}'),&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; v2_tbl(1,2,3,4,5),&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 0));&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;end;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;adding 1 to 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;adding 2 to 1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;adding 3 to 3&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;adding 4 to 6&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;adding 5 to 10&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;15&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It is also possible to write state-saving code, for example a number generator:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;declare&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; l lambda := lambda(q'{&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; declare&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; v_result number := :a+1;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; begin&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; :r := v_result;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dbms_sql.bind_variable(:c,'a',v_result,32767);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end;}',&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'a',0);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; l.bind('c',l.c);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; for i in 1 .. 10 loop&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; dbms_output.put_line(l.exec);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; end loop;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;end;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;1&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;2&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;3&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;4&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;5&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;6&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;7&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;8&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;9&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;10&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The code for lambda:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;create or replace type lambda as object ( &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; c number,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; constructor function lambda (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_sql in varchar2,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n1 &amp;nbsp;in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v1 &amp;nbsp;in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n2 &amp;nbsp;in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v2 &amp;nbsp;in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n3 &amp;nbsp;in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v3 &amp;nbsp;in varchar2 default null )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return self as result,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; member procedure bind (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self in lambda,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n in varchar2,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v in varchar2 ),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; member procedure exec (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self in lambda ),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; member function exec (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self &amp;nbsp; &amp;nbsp; in lambda,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n1 &amp;nbsp; &amp;nbsp; in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v1 &amp;nbsp; &amp;nbsp; in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n2 &amp;nbsp; &amp;nbsp; in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v2 &amp;nbsp; &amp;nbsp; in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n3 &amp;nbsp; &amp;nbsp; in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v3 &amp;nbsp; &amp;nbsp; in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_result in varchar2 default 'r')&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return varchar2,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; member function value (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self in lambda,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n in varchar2 )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return varchar2,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; member procedure close (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self in lambda )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;show err&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;create or replace type body lambda as&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; constructor function lambda (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_sql in varchar2,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n1 &amp;nbsp;in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v1 &amp;nbsp;in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n2 &amp;nbsp;in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v2 &amp;nbsp;in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n3 &amp;nbsp;in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v3 &amp;nbsp;in varchar2 default null )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return self as result&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; is&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; begin&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c := dbms_sql.open_cursor;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dbms_sql.parse(c,p_sql,dbms_sql.native);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if p_n1 is not null then&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.bind(p_n1,p_v1);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end if;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if p_n2 is not null then&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.bind(p_n2,p_v2);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end if;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if p_n3 is not null then&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.bind(p_n3,p_v3);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end if;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; end;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; member procedure bind (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self in lambda,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n in varchar2,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v in varchar2 )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; is&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; begin&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dbms_sql.bind_variable(self.c,p_n,p_v,32767);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; end;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; member procedure exec (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self in lambda )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; is&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; l_num_processed number;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; begin&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; l_num_processed := dbms_sql.execute(c);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; end;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; member function exec (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self &amp;nbsp; &amp;nbsp; in lambda,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n1 &amp;nbsp; &amp;nbsp; in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v1 &amp;nbsp; &amp;nbsp; in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n2 &amp;nbsp; &amp;nbsp; in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v2 &amp;nbsp; &amp;nbsp; in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n3 &amp;nbsp; &amp;nbsp; in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_v3 &amp;nbsp; &amp;nbsp; in varchar2 default null,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_result in varchar2 default 'r')&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return varchar2&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; is&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; begin&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.bind(p_result,null);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if p_n1 is not null then&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.bind(p_n1,p_v1);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end if;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if p_n2 is not null then&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.bind(p_n2,p_v2);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end if;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if p_n3 is not null then&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.bind(p_n3,p_v3);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end if;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.exec;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return self.value(p_result);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; end;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; member function value (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self in lambda,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p_n in varchar2 )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return varchar2&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; is&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; l_val varchar2(32767);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; begin&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dbms_sql.variable_value(self.c,p_n,l_val);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return l_val;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; end;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; member procedure close (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self in lambda )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; is&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; l_c number := self.c;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; begin&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dbms_sql.close_cursor(l_c);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; end;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;end;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;show err&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-3521435171770994487?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/3521435171770994487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=3521435171770994487' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/3521435171770994487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/3521435171770994487'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2011/07/closures-in-plsql.html' title='Closures in PL/SQL'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-2406731912948844168</id><published>2010-08-19T12:36:00.000-07:00</published><updated>2010-08-19T12:36:08.660-07:00</updated><title type='text'>change user in pl/sql</title><content type='html'>Just a quick note about a feature of an internal datapump package (&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sys.kupp$proc&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; in&lt;/span&gt; prvtbpp.plb&lt;/span&gt;) that I stumbled upon &lt;a href="http://www.red-database-security.com/wp/best_of_oracle_security_2008.pdf"&gt;here&lt;/a&gt;, tested on 11gR1:&lt;br /&gt;&lt;blockquote style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;SQL&amp;gt; select * from v$version;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;BANNER&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production&lt;br /&gt;PL/SQL Release 11.1.0.6.0 - Production&lt;br /&gt;CORE&amp;nbsp;&amp;nbsp;&amp;nbsp; 11.1.0.6.0&amp;nbsp;&amp;nbsp;&amp;nbsp; Production&lt;br /&gt;TNS for Linux: Version 11.1.0.6.0 - Production&lt;br /&gt;NLSRTL Version 11.1.0.6.0 - Production&lt;br /&gt;&lt;br /&gt;5 Zeilen ausgewählt.&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;SQL&amp;gt; conn cneu/xxxxxxxxxxx&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Connect durchgeführt.&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;SQL&amp;gt; select user from dual;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;USER&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;------------------------------&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;CNEU&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;1 Zeile wurde ausgewählt.&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;SQL&amp;gt; exec sys.kupp$proc.change_user('SYS')&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;PL/SQL-Prozedur erfolgreich abgeschlossen.&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;SQL&amp;gt; select user from dual;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;USER&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;------------------------------&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;SYS&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;1 Zeile wurde ausgewählt.&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;/blockquote&gt;Execute is granted to EXECUTE_CATALOG_ROLE, which is available to DBA,&lt;br /&gt;IMP_FULL_DATABASE, EXP_FULL_DATABASE and SYS. My CNEU user has DBA rights.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-2406731912948844168?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/2406731912948844168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=2406731912948844168' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/2406731912948844168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/2406731912948844168'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2010/08/change-user-in-plsql.html' title='change user in pl/sql'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-7454244024544048234</id><published>2010-07-16T06:18:00.000-07:00</published><updated>2010-07-16T06:26:41.905-07:00</updated><title type='text'>CLOB to VARCHAR2 conversion problems on UTF8 databases</title><content type='html'>&lt;div style="font-family: inherit;"&gt;Some well-known facts:&lt;/div&gt;&lt;ul style="font-family: inherit;"&gt;&lt;li&gt;VARCHAR2 has a max size of 32767 characters&lt;/li&gt;&lt;li&gt;UTF8 is a multi-byte character set, one character uses up to 4 bytes&lt;/li&gt;&lt;li&gt;32767/4 = 8191.75&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: inherit;"&gt;It looks like there are conversion problems when copying from a CLOB to a VARCHAR2 on UTF8 databases. If the VARCHAR2 gets assigned a CLOB (either directly or via SUBSTR(clob,...)) of more than 8191 characters, this raises VALUE_ERROR (see example below). If reading via DBMS_LOB.SUBSTR, the result gets &lt;i&gt;truncated &lt;/i&gt;to 8191 characters. Reading via DBMS_LOB.READ works as expected.&lt;br /&gt;&lt;br /&gt;An annoying inconsistency. DB was 11.1.0.6 on Windows.&lt;/div&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;&lt;br /&gt;CN@cn&amp;gt; select value from v$nls_parameters where parameter='NLS_CHARACTERSET';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;VALUE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;----------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;WE8MSWIN1252&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;CN@cn&amp;gt; declare&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  2    c clob;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  3    v varchar2(10000);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  4  begin&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  5   for i in 8191 .. 8192 loop&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  6      v := rpad('abc',i);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  7      c := v;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  8      dbms_output.put_line('Trying length '||i||'...');&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  9      v := c;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt; 10      dbms_output.put_line('...ok');&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt; 11   end loop;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt; 12  end;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt; 13  /&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;Trying length 8191...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;...ok&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;Trying length 8192...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;...ok&lt;br /&gt;PL/SQL-Prozedur erfolgreich abgeschlossen.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;CN@cn&amp;gt; conn cn/test@cnutf&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;Connect durchgef▒hrt.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;CN@cnutf&amp;gt; select value from v$nls_parameters where parameter='NLS_CHARACTERSET';&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;VALUE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;----------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;AL32UTF8&lt;br /&gt;CN@cnutf&amp;gt; declare&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  2    c clob;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  3    v varchar2(10000);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  4  begin&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  5   for i in 8191 .. 8192 loop&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  6      v := rpad('abc',i);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  7      c := v;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  8      dbms_output.put_line('Trying length '||i||'...');&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;  9      v := c;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt; 10      dbms_output.put_line('...ok'); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt; 12  end;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt; 13  /&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;Trying length 8191...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;...ok&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;Trying length 8192...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;declare&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;*&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;FEHLER in Zeile 1:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;ORA-06502: PL/SQL: numerischer oder Wertefehler&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier; white-space: pre;"&gt;ORA-06512: in Zeile 9&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-7454244024544048234?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/7454244024544048234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=7454244024544048234' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/7454244024544048234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/7454244024544048234'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2010/07/clob-to-varchar2-conversion-problems-on.html' title='CLOB to VARCHAR2 conversion problems on UTF8 databases'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-2295019623031422250</id><published>2010-07-07T10:25:00.000-07:00</published><updated>2010-07-07T10:26:48.193-07:00</updated><title type='text'>Writing parsers with m4o</title><content type='html'>&lt;div style="font-family: inherit;"&gt;This is a short example of my latest addition to the m4o toolchain. With m4o_lexer you can quite easily write simple LL(1) recursive descent parsers for domain-specific languages in PL/SQL. The lexer is implemented via regexp_substr and regexp_instr. This probably means that performance is not great, but for small code that's not an issue.&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;@package-begin sample_parser&lt;br /&gt;&amp;nbsp; @plsql&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c_equal constant m4o_lexer.token_t := 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c_plus&amp;nbsp; constant m4o_lexer.token_t := 2;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c_begin constant m4o_lexer.token_t := 3;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c_end&amp;nbsp;&amp;nbsp; constant m4o_lexer.token_t := 4;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c_if&amp;nbsp;&amp;nbsp;&amp;nbsp; constant m4o_lexer.token_t := 5;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c_then&amp;nbsp; constant m4o_lexer.token_t := 6;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c_else&amp;nbsp; constant m4o_lexer.token_t := 7;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c_ident constant m4o_lexer.token_t := 99;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c_num&amp;nbsp;&amp;nbsp; constant m4o_lexer.token_t := 100;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; procedure parse_stmtseq;&lt;br /&gt;&amp;nbsp; @end&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;&amp;nbsp; @procedure parse_assign&lt;br /&gt;&amp;nbsp; @declare&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; v_var&amp;nbsp;&amp;nbsp; varchar2(30);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; v_value varchar2(30);&lt;br /&gt;&amp;nbsp; @begin&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -- [ident] = [num]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; v_var&amp;nbsp;&amp;nbsp; := m4o_lexer.text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat(c_ident);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat(c_equal);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; v_value := m4o_lexer.text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat(c_num);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms_output.put_line('assigning '&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ||v_value&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ||' to '&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ||v_var);&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; @end&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;&amp;nbsp; @procedure parse_if&lt;br /&gt;&amp;nbsp; @begin&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat(c_if);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat(c_ident);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat(c_equal);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat(c_num);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat(c_then);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; parse_stmtseq;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if m4o_lexer.cur = c_else then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parse_stmtseq;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end if;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat(c_end);&lt;br /&gt;&amp;nbsp; @end&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;&amp;nbsp; @procedure parse_stmtseq&lt;br /&gt;&amp;nbsp; @begin&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; loop&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case m4o_lexer.cur&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when c_if then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parse_if;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when c_ident then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parse_assign;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when c_begin then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parse_stmtseq;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat(c_end);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end case;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end loop;&lt;br /&gt;&amp;nbsp; @end&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;&amp;nbsp; @procedure parse*&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i_code in varchar2&lt;br /&gt;&amp;nbsp; @begin&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.begin_define_tokens;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.set_whitespace('[[:space:]]+');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.set_token(c_equal,'=');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.set_token(c_plus ,'\\+');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.set_token(c_begin,'begin');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.set_token(c_end&amp;nbsp; ,'end');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.set_token(c_if&amp;nbsp;&amp;nbsp; ,'if');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.set_token(c_then ,'then');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.set_token(c_else ,'else');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.set_token(c_ident,'[a-z][a-z0-9_#$]*');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.set_token(c_num&amp;nbsp; ,'[0-9]+');&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.begin_reading(i_code);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat(c_begin);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; parse_stmtseq;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.eat(c_end);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m4o_lexer.end_reading;&lt;br /&gt;&amp;nbsp; @end&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;&amp;nbsp; @procedure main*&lt;br /&gt;&amp;nbsp; @begin&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; parse(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'begin&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = 3&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF FOO = 7 THEN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I = 5&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bar = 10&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else begin b=0 end end&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end');&lt;br /&gt;&amp;nbsp; @end&lt;br /&gt;@package-end&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-2295019623031422250?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/2295019623031422250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=2295019623031422250' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/2295019623031422250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/2295019623031422250'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2010/07/writing-parsers-with-m4o.html' title='Writing parsers with m4o'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-984019556286492792</id><published>2010-05-01T11:43:00.000-07:00</published><updated>2010-05-01T11:43:15.432-07:00</updated><title type='text'>hanging an oracle process: easy as that</title><content type='html'>Because it's labour day, I did some work on meta-pl/sql again. It was refactoring time and soon I will add another language feature - macros. But that's another topic. &lt;br /&gt;&lt;br /&gt;Due to a silly typo, I had a hanging oracle process (one of the nasties where "alter system kill session" does not work):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;create or replace package hang as&lt;br /&gt;  subtype t is hang.t;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So it was time to freshen &lt;a href="http://blog.tanelpoder.com/2008/06/19/killing-an-oracle-process-from-inside-oracle/"&gt;oradebug&lt;/a&gt; skills.&lt;br /&gt;&lt;br /&gt;I only tested the hangs on my local development machine (11gR1 linux), but remember similar troubles due to dependencies between views and packages on other releases, too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-984019556286492792?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/984019556286492792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=984019556286492792' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/984019556286492792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/984019556286492792'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2010/05/hanging-oracle-process-easy-as-that.html' title='hanging an oracle process: easy as that'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-8292718543924779368</id><published>2010-01-08T06:23:00.000-08:00</published><updated>2010-04-18T02:36:48.318-07:00</updated><title type='text'>Hello Meta-PL/SQL, Hello M4O</title><content type='html'>Despite the temptation of playing with the APEX 4.0 preview, I used the winter holidays to clean up and finally publish an open source project. It's called M4O and implements a new programming language, Meta-PL/SQL, which is an extension of Oracle's PL/SQL. It features a simpler package syntax, aspect oriented programming and language extensibility.&lt;br /&gt;&lt;br /&gt;Further information is available on &lt;a href="http://code.google.com/p/m4o/"&gt;http://code.google.com/p/m4o/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Here's a teaser of what Meta-PL/SQL looks like:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;@package-begin greeter_pkg&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; @procedure hello_dbms_output*&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i_name in varchar2&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; @begin&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; &amp;nbsp; dbms_output.put_line('Hello, ${nvl(i_name,'stranger')}!');&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; @end&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; @procedure hello_web*&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i_name in varchar2&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; @begin&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;lt;h1&amp;gt;Hello, &amp;lt;%=nvl(i_name,'stranger')%&amp;gt;!&amp;lt;/h1&amp;gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;@end&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;@package-end&lt;/div&gt;&lt;br /&gt;generates&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;create or replace package greeter_pkg as&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; procedure hello_dbms_output(i_name in varchar2);&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; procedure hello_web(i_name in varchar2);&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;end;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;create or replace package body greeter_pkg as&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; procedure hello_dbms_output(i_name in varchar2)&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; is&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; begin&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; -- log that greeter_pkg.hello_dbms_output was called with&amp;nbsp;&amp;nbsp; i_name&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms_output.put_line('Hello, '||nvl(i_name,'stranger')||'!');&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; end;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; procedure hello_web(i_name in varchar2)&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; is&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; begin&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; -- log that greeter_pkg.hello_web was called with i_name&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; htp.p('&amp;lt;h1&amp;gt;Hello, '||nvl(i_name,'stranger')||'!&amp;lt;/h1&amp;gt;');&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; end;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;end;&lt;/div&gt;&lt;br /&gt;Please note that this is a very early release and a few planned features are missing. A previous version of Meta-PL/SQL has been in production use since summer 2008, however.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-8292718543924779368?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/8292718543924779368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=8292718543924779368' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/8292718543924779368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/8292718543924779368'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2010/01/hello-meta-plsql-hello-m4o.html' title='Hello Meta-PL/SQL, Hello M4O'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-1262513366095470843</id><published>2009-11-05T10:38:00.000-08:00</published><updated>2009-11-10T11:02:17.171-08:00</updated><title type='text'>Hacking Oracle APEX IR reloads</title><content type='html'>Writing is hard and I am lazy. Here's another try, however.&lt;br /&gt;&lt;br /&gt;Over time, our internal APEX framework acquired a few features that are quite nice. For some of them, we had to find workarounds for stuff that isn't directly supported. Thankfully, on the server side the APEX engine can be influenced (e.g. variables in package &lt;span style="font-family:courier new;"&gt;wwv_flow&lt;/span&gt;) and JavaScript/CSS can manipulate the display and behaviour on the client side. The former is totally unsupported/undocumented and the latter to a certain part, however. As long as it works we can live with that, because our applications will run on intranets where we can control the environment.&lt;br /&gt;&lt;br /&gt;The latest hack had to do with interactive reports. To implement a feature (right-mouse popup over some columns, metadata-driven content), we had to run JavaScript code on the client that modified the IR table's HTML. It worked pretty well except after AJAX refreshes, which of course are integral to IRs. The APEX AJAX code replaced the HTML table including my code's changes with new one from the server. The older partial page refreshable reports called &lt;span style="font-family:courier new;"&gt;init_htmlPPRReport&lt;/span&gt; which could be overwritten to put the changes back in again (see &lt;a href="http://www.inside-oracle-apex.com/how-to-run-javascript-code-for-ppr-report/"&gt;here&lt;/a&gt;) but no such luck with IRs. After wading through the code of &lt;span style="font-style: italic;"&gt;apex_ns_3_1.js&lt;/span&gt; I found out that the refresh code called &lt;span style="font-family:courier new;"&gt;$x_Show('apexir_REPORT')&lt;/span&gt; at the end. I overwrote that and now everything works.&lt;br /&gt;&lt;br /&gt;So, what's the bottom line? I think Oracle would do developers a great favour if they included standardized and supported hooks for extension writers to plug their code in. For my example above, say, there might be a JavaScript function&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;apex.hooks.after_region_reload = function(i_region_id) {}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;that gets called after partial page refreshes and could be overwritten. Better, make that an Array of functions, initially empty, so we can&lt;br /&gt;&lt;span style="white-space:pre;font-family:courier new;" &gt;&lt;br /&gt;apex.hooks.after_region_reload.push(&lt;br /&gt;  function(i_region_id) {&lt;br /&gt;    alert("do something extension specific");&lt;br /&gt;  });&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Patrick, can you hear me? *g*&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-1262513366095470843?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/1262513366095470843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=1262513366095470843' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/1262513366095470843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/1262513366095470843'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2009/11/hacking-oracle-apex-ir-reloads.html' title='Hacking Oracle APEX IR reloads'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-3574465658330134402</id><published>2009-02-06T06:49:00.000-08:00</published><updated>2009-02-06T07:02:50.632-08:00</updated><title type='text'>APEX: Checkboxes in tabular reports</title><content type='html'>This is a response to Patrick Wolf's posting &lt;a href="http://www.inside-oracle-apex.com/checkboxes-in-tabular-forms-the-easy-way/"&gt;Checkboxes in Tabular Forms - The easy way!&lt;/a&gt;. I think I found a solution that's even easier than that of one of the APEX gurus ;-). Because Patrick's blog software ate my html comments, I'll write it here again.&lt;br /&gt;&lt;br /&gt;First, the generic CSS and JavaScript part. In my test case I put the following code in the page header. If something like this goes production, it should be in separate files, of course:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt;.js_checkbox { display:none; }&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script language="JavaScript" type="text/javascript"&amp;gt;&lt;br /&gt; function set_yn(i_checkbox,i_apex_field_id) {&lt;br /&gt;   document.getElementById(i_apex_field_id).value =&lt;br /&gt;     (i_checkbox.checked? "Y" : "N");&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; $().ready(function() {&lt;br /&gt;   $(".js_checkbox").each(function() {&lt;br /&gt;     $(this).after("&amp;lt;input id='"+this.id+"_js' type='checkbox' "+&lt;br /&gt;                   (this.value==="Y" ? "checked='checked' " : "") +&lt;br /&gt;                   "onchange='javascript:set_yn(this,"+'"'+this.id+'"'+")'/&amp;gt;");&lt;br /&gt;   });&lt;br /&gt; });&lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Second, the column definition:&lt;br /&gt;&lt;blockquote&gt;* Display As: Text Field (the default)&lt;br /&gt;* Element Attributes: class="js_checkbox"&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Please note that this code is just a quick hack in response to Patrick's topic, not thoroughly tested etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-3574465658330134402?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/3574465658330134402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=3574465658330134402' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/3574465658330134402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/3574465658330134402'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2009/02/apex-checkboxes-in-tabular-reports.html' title='APEX: Checkboxes in tabular reports'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-2663478723998707348</id><published>2008-06-11T23:43:00.000-07:00</published><updated>2008-06-12T01:23:08.323-07:00</updated><title type='text'>An aggregate function for collection types</title><content type='html'>Today I stumbled upon a &lt;a href="http://orajourn.blogspot.com/2008/06/stragg.html"&gt;blog entry&lt;/a&gt; where the poster needs something like Tom Kyte's &lt;a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:15637744429336"&gt;stragg&lt;/a&gt; function, only with dynamic delimiters. Here's my solution, using a variation of stragg that accumulates data in a collection instead of appending it to a string.&lt;br /&gt;&lt;br /&gt;First of all, this is how you use it:&lt;br /&gt;&lt;pre&gt;SQL&gt; r&lt;br /&gt;1  with data as (&lt;br /&gt;2  select lpad('x',level,'x') data&lt;br /&gt;3  from dual&lt;br /&gt;4  connect by level &lt;= 5)&lt;br /&gt;5  select v2_pkg.join(v2_agg(data),'-')&lt;br /&gt;6* from data&lt;br /&gt;&lt;br /&gt; V2_PKG.JOIN(V2_AGG(DATA),'-')&lt;br /&gt; --------------------------------------------------------------------------------&lt;br /&gt; x-xx-xxx-xxxx-xxxxx&lt;br /&gt;&lt;br /&gt; 1 Zeile wurde ausgewählt.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The v2_agg function (and it's underlying object type) append strings to a collection. The v2_pkg.join concatenates the elements of it's first argument (the collection) with the second argument in between. See below for the source code. It's part of my everyday toolkit, v2_pkg contains lots more, for example.&lt;br /&gt;&lt;br /&gt;The collection type&lt;br /&gt;&lt;pre&gt;create type v2_tbl as table of varchar2(4000);&lt;/pre&gt;&lt;br /&gt;The aggregate object type spec&lt;br /&gt;&lt;pre&gt;create or replace type v2_agg_type as object (                                  &lt;br /&gt;  elements v2_tbl,&lt;br /&gt;  static function&lt;br /&gt;    ODCIAggregateInitialize(sctx IN OUT v2_agg_type )&lt;br /&gt;    return number,&lt;br /&gt;  member function&lt;br /&gt;    ODCIAggregateIterate(self IN OUT v2_agg_type ,&lt;br /&gt;                         value IN varchar2 )&lt;br /&gt;    return number,&lt;br /&gt;  member function&lt;br /&gt;    ODCIAggregateTerminate(self IN v2_agg_type,&lt;br /&gt;                           returnValue OUT  v2_tbl,&lt;br /&gt;                           flags IN number)&lt;br /&gt;    return number,&lt;br /&gt;  member function&lt;br /&gt;    ODCIAggregateMerge(self IN OUT v2_agg_type,&lt;br /&gt;                       ctx2 IN v2_agg_type)&lt;br /&gt;    return number&lt;br /&gt;);                                       &lt;br /&gt;/&lt;/pre&gt;&lt;br /&gt;The aggregate function&lt;br /&gt;&lt;pre&gt;create or replace function v2_agg(input varchar2)&lt;br /&gt;return v2_tbl                                                                 &lt;br /&gt;parallel_enable aggregate using v2_agg_type;&lt;br /&gt;/&lt;/pre&gt;&lt;br /&gt;The utility package spec&lt;br /&gt;&lt;pre&gt;create or replace package v2_pkg as&lt;br /&gt;  function join(i_tbl in v2_tbl,&lt;br /&gt;                i_glue in varchar2 := ',')&lt;br /&gt;  return varchar2;&lt;br /&gt;end;&lt;br /&gt;/&lt;/pre&gt;&lt;br /&gt;The object type body&lt;br /&gt;&lt;pre&gt;create or replace type body v2_agg_type  is&lt;br /&gt;  static function ODCIAggregateInitialize(sctx IN OUT v2_agg_type)&lt;br /&gt;  return number&lt;br /&gt;  is&lt;br /&gt;  begin&lt;br /&gt;    sctx := v2_agg_type( null );&lt;br /&gt;    return ODCIConst.Success;&lt;br /&gt;  end;&lt;br /&gt;  member function ODCIAggregateIterate(self IN OUT v2_agg_type,&lt;br /&gt;                                       value IN varchar2 )&lt;br /&gt;  return number&lt;br /&gt;  is&lt;br /&gt;  begin&lt;br /&gt;    if self.elements is null then&lt;br /&gt;      self.elements := v2_tbl();&lt;br /&gt;    end if;&lt;br /&gt;    self.elements.extend;&lt;br /&gt;    self.elements(self.elements.count) := value;&lt;br /&gt;    return ODCIConst.Success;&lt;br /&gt;  end;&lt;br /&gt;  member function ODCIAggregateTerminate(self IN v2_agg_type,&lt;br /&gt;                                         returnValue OUT v2_tbl,&lt;br /&gt;                                         flags IN number)&lt;br /&gt;  return number&lt;br /&gt;  is&lt;br /&gt;  begin&lt;br /&gt;    returnValue := self.elements;&lt;br /&gt;    return ODCIConst.Success;&lt;br /&gt;  end;&lt;br /&gt;  member function ODCIAggregateMerge(self IN OUT v2_agg_type,&lt;br /&gt;                                     ctx2 IN v2_agg_type)&lt;br /&gt;  return number&lt;br /&gt;  is&lt;br /&gt;  begin&lt;br /&gt;    if ctx2.elements is not null then&lt;br /&gt;      if self.elements is null then&lt;br /&gt;        self.elements := v2_tbl();&lt;br /&gt;      end if;&lt;br /&gt;      for i in 1 .. ctx2.elements.count loop&lt;br /&gt;        self.elements.extend;&lt;br /&gt;        self.elements(self.elements.count) := ctx2.elements(i);&lt;br /&gt;      end loop;&lt;br /&gt;    end if;&lt;br /&gt;    return ODCIConst.Success;&lt;br /&gt;  end;&lt;br /&gt;end;&lt;br /&gt;/&lt;/pre&gt;&lt;br /&gt;The utility package body&lt;br /&gt;&lt;pre&gt;create or replace package body v2_pkg as&lt;br /&gt;   function join(i_tbl  in v2_tbl,&lt;br /&gt;                 i_glue in varchar2 := ',')&lt;br /&gt;  return varchar2&lt;br /&gt;  is&lt;br /&gt;    v_str varchar2(32767);&lt;br /&gt;  begin&lt;br /&gt;    IF i_tbl is not null THEN&lt;br /&gt;      FOR i in 1 .. i_tbl.count LOOP&lt;br /&gt;        v_str := v_str || i_glue || i_tbl(i);&lt;br /&gt;      END LOOP;&lt;br /&gt;    END IF;&lt;br /&gt;    return substr(v_str,length(i_glue)+1);&lt;br /&gt;  end;&lt;br /&gt;end;&lt;br /&gt;/&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;By the way, Oracle's COLLECT function might be more appropriate than v2_agg for large datasets. &lt;a href="http://www.oracle-developer.net/display.php?id=306"&gt;This post&lt;/a&gt; explains why.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-2663478723998707348?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/2663478723998707348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=2663478723998707348' title='37 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/2663478723998707348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/2663478723998707348'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2008/06/aggregate-function-for-collection-types.html' title='An aggregate function for collection types'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>37</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-2690908185030289796</id><published>2008-03-28T04:32:00.000-07:00</published><updated>2008-03-28T04:51:42.773-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='11g'/><category scheme='http://www.blogger.com/atom/ns#' term='forms'/><title type='text'>Forms 6i certified with Oracle 11g?</title><content type='html'>Today I found &lt;a href="http://blogs.oracle.com/schan/2008/03/27#a2532"&gt;this&lt;/a&gt; entry on &lt;a href="http://blogs.oracle.com/schan/"&gt;Steven Chan's Oracle E-Business Suite Technology blog&lt;/a&gt;. It's titled "Oracle Database 11g Release 1 (11.1.0.6.0) Certified With E-Business Suite Release 11i".&lt;br /&gt;&lt;br /&gt;EBS 11i uses the Developer 6i techstack, for which extended support ended last january. I think it's great (and highly amusing) that Oracle now blessed this configuration. There was probably a lot of customer pressure, so Oracle realized that reality does not conform with their product support plans ;-).&lt;br /&gt;&lt;br /&gt;I also wonder if this certification only applies to EBS 11i or Dev6i in general (i.e. also good old client/server deployment). Probably not, but one can hope.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-2690908185030289796?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/2690908185030289796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=2690908185030289796' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/2690908185030289796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/2690908185030289796'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2008/03/forms-6i-certified-with-oracle-11g.html' title='Forms 6i certified with Oracle 11g?'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-5300984302482749660</id><published>2008-02-22T05:07:00.000-08:00</published><updated>2008-02-22T05:21:44.863-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='apex'/><title type='text'>Comfortable javascript editing in APEX</title><content type='html'>&lt;img src="http://bp0.blogger.com/_oxSbQnaojeU/R77Jlnjii4I/AAAAAAAAADA/Sck3Z30OZOM/s320/apex_form_element_js.png" /&gt;&lt;br /&gt;&lt;p/&gt;&lt;br /&gt;This week, I built a small extension to Patrick Wolf's APEX Builder Plugin. It generates separate text fields for javascript events. Makes writing event code quite a bit easier.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-5300984302482749660?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/5300984302482749660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=5300984302482749660' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/5300984302482749660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/5300984302482749660'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2008/02/comfortable-javascript-editing-in-apex.html' title='Comfortable javascript editing in APEX'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_oxSbQnaojeU/R77Jlnjii4I/AAAAAAAAADA/Sck3Z30OZOM/s72-c/apex_form_element_js.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-1566417221858856085</id><published>2008-01-29T03:13:00.000-08:00</published><updated>2008-01-29T07:01:06.189-08:00</updated><title type='text'>Maybe it's time to re-think what web development should be about</title><content type='html'>I just came about &lt;a href="http://bitworking.org/news/290/JavaScript-is-the-new-Smalltalk"&gt;this link&lt;/a&gt; and am currently half-way through Dan Ingall's Google &lt;a href="http://www.youtube.com/watch?v=gGw09RZjQf8"&gt;TechTalk&lt;/a&gt;. Wow!&lt;br /&gt;&lt;br /&gt;Btw, there is also &lt;a href="http://lemonodor.com/archives/001486.html"&gt;Smalltalk in Flash&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-1566417221858856085?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/1566417221858856085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=1566417221858856085' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/1566417221858856085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/1566417221858856085'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2008/01/maybe-its-time-to-re-think-what-web.html' title='Maybe it&apos;s time to re-think what web development should be about'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-9057430196224641914</id><published>2008-01-19T10:56:00.000-08:00</published><updated>2008-01-19T11:41:36.904-08:00</updated><title type='text'>Object oriented database management systems</title><content type='html'>Recently, there were several blog posts about ODBMSs. It all started with &lt;a href="http://www.acmqueue.com/modules.php?name=Content&amp;pa=showpage&amp;pid=489"&gt;this&lt;/a&gt; interview of Michael Stonebraker.&lt;br /&gt;Dan Weinreb (ex ObjectStore) &lt;a href="http://dlweinreb.wordpress.com/2007/12/31/object-oriented-database-management-systems-succeeded/"&gt;responded&lt;/a&gt; and today I read a &lt;a href="http://tahitiviews.blogspot.com/2008/01/relational-vs-oo-databases.html"&gt;blog post&lt;/a&gt; of Oracle's John Russell.&lt;br /&gt;&lt;br /&gt;In the early/mid 90ies, when I was still on university and hooked on OO, ODBMSs had a big fascination for me. I read every book and paper about them I could get and had uni accounts on machines to play with Gemstone and ObjectStore. Hell, I even wrote one myself, in c++ and tcl (chaos - chris' alternative object store;-)). &lt;br /&gt;&lt;br /&gt;Accidently, my first job was with Oracle 7 and Forms/Reports, "boring" technology or so I thought. This changed quickly, when I realized how efficient development in this environment was. It turned out that I didn't need all that fancy OO stuff I thought indispensable to get things done and have fun working. In some way, programming pl/sql even reminds me of the Gemstone/Smalltalk days. My interface seems minimalistic in comparison (sql*plus and vi), but it's only the interface to that powerful, persistent multiuser sql and pl/sql machine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-9057430196224641914?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/9057430196224641914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=9057430196224641914' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/9057430196224641914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/9057430196224641914'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2008/01/object-oriented-database-management.html' title='Object oriented database management systems'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-9000880002655934251</id><published>2007-12-31T10:58:00.000-08:00</published><updated>2008-04-22T05:28:44.464-07:00</updated><title type='text'>Javascript</title><content type='html'>This is a fun language. It contains pretty good stuff and annoying incompatibilities. However, it's one of the &lt;a href="http://steve-yegge.blogspot.com/2007/02/next-big-language.html"&gt;most important&lt;/a&gt; languages for software developers and just now, I'm very lately trying to get a better grip, because of this current project. I've hacked an odd XMLHttpRequest before it was called AJAX, but now we've got additional problems. Our SW has to run on hand-helds, so we've got special keyboard and performance requirements, e.g. we can't use the framework of my former colleague &lt;a href="http://inside-apex.blogspot.com/"&gt;Patrick Wolf&lt;/a&gt;. According to Doug Crockford, there are no acceptable books. The available Javascript source code for &lt;a href="http://www.blogger.com/apex.oracle.com"&gt;Oracle APEX&lt;/a&gt;, the platform we'll of course use as die-hard Oracleheads, is ugly, especially compared to what Crockford and others &lt;a href="http://developer.yahoo.com/yui/theater/"&gt;preach&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-9000880002655934251?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/9000880002655934251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=9000880002655934251' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/9000880002655934251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/9000880002655934251'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2007/12/javascript.html' title='Javascript'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-2625849306951407942</id><published>2007-06-09T11:16:00.000-07:00</published><updated>2007-09-16T10:26:47.725-07:00</updated><title type='text'>Rob Pike on video, Plan 9 flashback</title><content type='html'>Today I watched a very recent &lt;a href="http://video.google.com/videoplay?docid=810232012617965344&amp;q=rob+pike"&gt;video&lt;/a&gt; of Rob Pike talking about his 20 year old language Newsqueak. &lt;br /&gt;&lt;br /&gt;I used his text editor "sam" on linux in the mid-90ies for a while, when &lt;a href="http://plan9.bell-labs.com/plan9/"&gt;Plan 9&lt;/a&gt; first came on my radar. What first impressed me was the paper accompanying the source code. The code itself is very elegant and minimalistic. Though it didn't take off (probably just because of those attributes, baroque featuritis wins in the end), there are some great ideas in Plan 9 that can provide inspiration. The plumbing paper for example gave me the idea for a generic navigation concept in an Oracle Forms application, in 2000. We called it "hyperlinks", though...&lt;br /&gt;&lt;br /&gt;After thinking about all that again, this post wouldn't be complete without mentioning &lt;a href="http://www.insultant.net"&gt;Boyd Roberts&lt;/a&gt;. The link's dead, of course.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-2625849306951407942?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/2625849306951407942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=2625849306951407942' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/2625849306951407942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/2625849306951407942'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2007/06/rob-pike-on-video-plan-9-flashback.html' title='Rob Pike on video, Plan 9 flashback'/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5273779003508186345.post-5474212752000427153</id><published>2007-03-19T12:00:00.000-07:00</published><updated>2007-03-22T04:38:28.178-07:00</updated><title type='text'></title><content type='html'>Well the first post is the hardest post. My stupid blog title was selected while listening to &lt;a href="http://arts.ucsc.edu/gdead/agdl/uncle.html"&gt;this song&lt;/a&gt; by the &lt;a href="http://www.archive.org/details/GratefulDead"&gt;Grateful Dead&lt;/a&gt;. Fnord.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5273779003508186345-5474212752000427153?l=unclechrisblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unclechrisblog.blogspot.com/feeds/5474212752000427153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5273779003508186345&amp;postID=5474212752000427153' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/5474212752000427153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5273779003508186345/posts/default/5474212752000427153'/><link rel='alternate' type='text/html' href='http://unclechrisblog.blogspot.com/2007/03/well-first-post-is-hardest-post.html' title=''/><author><name>Chris</name><uri>http://www.blogger.com/profile/00349422981782291908</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
