<?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:blogger='http://schemas.google.com/blogger/2008' 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-7853996043734512777</id><updated>2024-08-29T15:10:47.632-07:00</updated><category term="PL/SQL"/><category term="Oracle"/><category term="Oracle 11g"/><category term="Разное"/><category term="Linux"/><category term="GlassFish"/><category term="DDL"/><category term="DML"/><category term="Eclipse Kepler"/><category term="Oracle 10g"/><category term="Oracle 12c"/><category term="Tomcat 7"/><category term="Ubuntu"/><title type='text'>Oracle in Russian</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-6105279887385212156</id><published>2014-01-04T10:29:00.002-08:00</published><updated>2014-01-04T10:29:40.582-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse Kepler"/><category scheme="http://www.blogger.com/atom/ns#" term="Tomcat 7"/><title type='text'>Eclipse Kepler + Tomcat 7</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Пост не по теме основного блога. Скорее это закладка на память.&lt;br /&gt;
Если при попытке добавить сервер Tomcat 7 ничего не получается, а экран New Server выглядит следующим образом (поле Server name пустое):&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS-TRMTJTxtXyGl9TiCGbStJSMkfG99_gt02NA1Xk-UOj_aEbvWyl_FAluGAcCK1dIz3uglNzPmiCAX4Ec84Ix6QRXuXxKYIMZncPvEb3azq3_iMASomKu_tIWsf4umz5MToCOOFehaZzd/s1600/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA+%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0+%D0%B8%D0%B7+2014-01-04+22:23:04.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS-TRMTJTxtXyGl9TiCGbStJSMkfG99_gt02NA1Xk-UOj_aEbvWyl_FAluGAcCK1dIz3uglNzPmiCAX4Ec84Ix6QRXuXxKYIMZncPvEb3azq3_iMASomKu_tIWsf4umz5MToCOOFehaZzd/s320/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA+%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0+%D0%B8%D0%B7+2014-01-04+22:23:04.png&quot; width=&quot;312&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
То надо выполнить следующие действия:&lt;br /&gt;
&lt;ol style=&quot;background-color: white; border: 0px; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Закрыть Eclipse&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;В&amp;nbsp;&lt;code id=&quot;&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings&amp;nbsp;&lt;/code&gt;удалить 2 файла:&lt;ul style=&quot;background-color: transparent; border: 0px; list-style: disc; margin: 0px 0px 0px 30px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;org.eclipse.wst.server.core.prefs&lt;/code&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;org.eclipse.jst.server.tomcat.core.prefs&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Перезапустить Eclipse&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;Первоисточник решения:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://stackoverflow.com/questions/14791843/eclipse-add-tomcat-7-blank-server-name&quot;&gt;http://stackoverflow.com/questions/14791843/eclipse-add-tomcat-7-blank-server-name&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/6105279887385212156/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2014/01/eclipse-kepler-tomcat-7.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/6105279887385212156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/6105279887385212156'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2014/01/eclipse-kepler-tomcat-7.html' title='Eclipse Kepler + Tomcat 7'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS-TRMTJTxtXyGl9TiCGbStJSMkfG99_gt02NA1Xk-UOj_aEbvWyl_FAluGAcCK1dIz3uglNzPmiCAX4Ec84Ix6QRXuXxKYIMZncPvEb3azq3_iMASomKu_tIWsf4umz5MToCOOFehaZzd/s72-c/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA+%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0+%D0%B8%D0%B7+2014-01-04+22:23:04.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-1836383194344087289</id><published>2013-11-10T06:32:00.003-08:00</published><updated>2013-11-10T06:33:37.314-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle 12c"/><title type='text'>[INS-30131] Initial setup required for the execution of installer validations failed. In Oracle Linux 6.4</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Решил я, наконец-то, попробовать Oracle 12c. Закатал в виртуалку свежий Oracle Linux 6.4, поставил xorg + gnome, выполнил магическое комбо&amp;nbsp;&lt;b style=&quot;background-color: white; color: #555555; font-family: Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;yum install oracle-rdbms-server-12cR1-preinstall&lt;/b&gt;, которое обещало мне безпроблемную установку базы данных, даже пользователю oracle изменил пароль, но, видимо, карма моя была недостаточно чиста, а индусы или кто там ещё, знали об этом заранее.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Проблема №1&lt;/b&gt;:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Получаем сообщение об ошибке, что нам отказано в доступе к &lt;b&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;database/install/.oui&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;chmod +x database/install/.oui&lt;/b&gt;&lt;/span&gt; решает эту проблему&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Проблема №2&lt;/b&gt;:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Полная аналогия с проблемой №1, только в этот раз нет доступа к &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;database/install/unzip&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;chmod +x database/install/unzip&lt;/b&gt;&lt;/span&gt;&amp;nbsp;решает эту проблему&lt;br /&gt;
&lt;br /&gt;
Подозреваю, что я сам виноват в этих ошибках, т.к. поленился распаковывать архивы из консоли с проставлением положенных флагов, а воспользовался гномом.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Проблема №3&lt;/b&gt; (из заголовка):&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;b&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;[INS-30131] Initial setup required for the execution of installer validations failed.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Самое странное, что, судя по интернету, страдают от неё пользователи Widows, но никто из пользователей Linux даже не упоминал о ней.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Решение: &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;chmod -R 777 /tmp/CVU_12.1.0.1.0_oracle/*&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Больше проблем не было. Разве что теперь Oracle 12c Enterpriыe Edition хочет под себя 6,5 гигов. Поэтому виртуальные диски лучше делать по 30 гигов, а не по 20, как раньше&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/1836383194344087289/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2013/11/ins-30131-initial-setup-required-for.html#comment-form' title='Комментарии: 5'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/1836383194344087289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/1836383194344087289'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2013/11/ins-30131-initial-setup-required-for.html' title='[INS-30131] Initial setup required for the execution of installer validations failed. In Oracle Linux 6.4'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-317777286055698787</id><published>2013-04-21T08:30:00.000-07:00</published><updated>2013-04-21T08:30:29.121-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Ubuntu 13.04 + Bumblebee + Lenovo Y580</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span id=&quot;goog_330431772&quot;&gt;&lt;/span&gt;&lt;a href=&quot;http://www.blogger.com/&quot;&gt;&lt;/a&gt;&lt;span id=&quot;goog_330431773&quot;&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Не дожидаясь недели до выхода Ubuntu 13.04 решил попробовать нового зверя. В основном благодаря куче багов в 12.10 и лестным отзывам по 13.04 на LOR.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Т.к. терять особо было нечего, да и диск надо было с виндой поделить немного иначе я остановился на чистой установке.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Ещё на Live-USB меня напрягло то, что подсветка экрана ноута после GRUB автоматом выставляется в 0, но хорошо, что это только подсветка, на Fedora 18 с ядром 3.8.x вообще на экране ничего не отображается.&lt;br /&gt;
Но вернёмся в установке шмеля и радостям высокопроизводительной графики, которая кушает батарейку только тогда, когда ей это позволяют.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Установка Bumblebee производилась по инструкции &lt;a href=&quot;http://help.ubuntu.ru/wiki/bumblebee&quot;&gt;http://help.ubuntu.ru/wiki/bumblebee&lt;/a&gt; , но, т.к. у меня ноут с особенностями, а эти особенности на уровне ядра будут поддерживаться только начиная с 3.8.5 и выше, то для текущего убунтовского ядра 3.8.0 надо собрать модуль.&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Чотобы это сделать надо выполнить в терминале следующую последовательность комманд:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;git clone git://github.com/Bumblebee-Project/bbswitch.git -b hack-lenovo&lt;br /&gt;cd bbswitch/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;В файле acpi-handle-hack.c заменить код функции &lt;/span&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;dev_set_acpi_handle&lt;/span&gt; с:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;static void dev_set_acpi_handle(struct pci_dev *pdev, acpi_handle handle) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; pdev-&amp;gt;dev.archdata.acpi_handle = handle;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;на:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;static void dev_set_acpi_handle(struct pci_dev *pdev, acpi_handle handle) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;#if LINUX_VERSION_CODE &amp;gt;= KERNEL_VERSION(3,8,0)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;pdev-&amp;gt;dev.acpi_node.handle = handle;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;#else&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;pdev-&amp;gt;dev.archdata.acpi_handle = handle;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;#endif&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;mkdir /usr/src/acpi-handle-hack-0.0.2&lt;br /&gt;sudo cp Makefile acpi-handle-hack.c /usr/src/acpi-handle-hack-0.0.2/&lt;br /&gt;sudo cp dkms/acpi-handle-hack.conf /usr/src/acpi-handle-hack-0.0.2/dkms.conf&lt;br /&gt;sudo dkms add acpi-handle-hack/0.0.2&lt;br /&gt;sudo dkms build acpi-handle-hack/0.0.2&lt;br /&gt;sudo dkms install acpi-handle-hack/0.0.2&lt;br /&gt;sudo echo acpi-handle-hack | sudo tee -a /etc/modules&lt;br /&gt;sudo update-initramfs -u&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Перезагрузить компьютер, либо выйти и войти.&lt;br /&gt;
Епосле всех этих манипуляций Optirun не заработал, надо в файле /etc/bumblebee/xorg.conf.nvidia добавить:&lt;br /&gt;
&lt;br /&gt;
BusID &quot;PCI:01:00:0&quot;&lt;br /&gt;
&lt;br /&gt;
в Section &quot;Device&quot;, где 01:00:0 - id вашей дискретной видеокарты, который можно узнать выполнив команд lspci.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/317777286055698787/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2013/04/ubuntu-1304-bumblebee-lenovo-y580.html#comment-form' title='Комментарии: 2'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/317777286055698787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/317777286055698787'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2013/04/ubuntu-1304-bumblebee-lenovo-y580.html' title='Ubuntu 13.04 + Bumblebee + Lenovo Y580'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-7534142562602467131</id><published>2013-02-22T04:22:00.001-08:00</published><updated>2013-02-22T04:23:36.556-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GlassFish"/><category scheme="http://www.blogger.com/atom/ns#" term="Разное"/><title type='text'>Glassfish Admin Console freezing at startup</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
If GlassFish Admin Console freezing at loading, and load after switch off all network interfaces, you need start it with option: -Djava.net.preferIPv4Stack=true&lt;br /&gt;
&lt;br /&gt;
How to add start option:&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Start server: &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;./asadmin start-domain&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Add option:&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;./asadmin create-jvm-options -Djava.net.preferIPv4Stack=true&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
Everything work fine now :) &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/7534142562602467131/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2013/02/glassfish-admin-console-freezing-at.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/7534142562602467131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/7534142562602467131'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2013/02/glassfish-admin-console-freezing-at.html' title='Glassfish Admin Console freezing at startup'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-1557930374149481531</id><published>2013-02-22T04:17:00.000-08:00</published><updated>2013-02-22T04:23:54.861-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GlassFish"/><category scheme="http://www.blogger.com/atom/ns#" term="Разное"/><title type='text'>Glassfish Admin Console зависает при загрузке</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Если консоль администратора GlassFish не запускается, а если отключить все сетевые соединения стартует, то его надо запускать с опцией: -Djava.net.preferIPv4Stack=true&lt;br /&gt;
&lt;br /&gt;
Делается это так:&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Запускаем сервер: &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;./asadmin start-domain&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Добавляем опцию:&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;./asadmin create-jvm-options -Djava.net.preferIPv4Stack=true&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
Теперь всё будет запускаться без проблем :) &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/1557930374149481531/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2013/02/glassfish-admin-console.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/1557930374149481531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/1557930374149481531'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2013/02/glassfish-admin-console.html' title='Glassfish Admin Console зависает при загрузке'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-6982315618426661619</id><published>2013-02-18T07:41:00.000-08:00</published><updated>2013-02-18T07:42:31.476-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Разное"/><title type='text'>Установка Oracle SQL Developer и Oracle SQL Developer Data Modeller на *.deb дистрибутив</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div&gt;
&amp;nbsp; В связи с переездом на новый ноутбук на который была поставлена не кошерная Ubuntu взамен кошерного Debian, который продолжает крутиться на старом. Мне пришлось проходить всё круги ада по настройке системы под разработку снова. В связи с этим родилась эта заметка.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; Итак, в данный момент Oracle SQL Developer и Oracle SQL Developer Data Modeller существуют в виде rpm-пакетов и zip-архивов (только Developer).&lt;br /&gt;
Я предпочитаю конвертировать софт из rpm в deb и устанавливать его при помощи менеджера пакетов.&lt;br /&gt;
&amp;nbsp; Качаем rpm`ки по ссылкам:&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Oracle SQL Developer (&lt;a href=&quot;http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html&quot;&gt;http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Oracle SQL Developer Data Modeller (&lt;a href=&quot;http://www.oracle.com/technetwork/developer-tools/datamodeler/downloads/index.html&quot;&gt;http://www.oracle.com/technetwork/developer-tools/datamodeler/downloads/index.html&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br /&gt;
Устанавливаем alien, если он ещё не установлен:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; apt-get install alien&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Натравливаем alien на rpm пакет:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; alien sqldeveloper-3.2.20.09.87-1.noarch.rpm&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
В результате получаем deb-пакет, который можем установить в свою систему:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dpkg -i sqldeveloper_3.2.20.09.87-2_all.deb&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Т.к. большинство популярных десктоп дистрибутивов успешно перешли на Gnome 3 и новую систему меню, то скорее всего в меню программ свежеустановленный софт не появится. Для этого нам необходимо создать desktop-файл, который необходимо поместить в ~/.local/share/applications&lt;br /&gt;
&lt;br /&gt;
Пример cсодержимого файла для SQL Developer:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;[Desktop Entry]&lt;br /&gt;Encoding=UTF-8&lt;br /&gt;Name=SQL Developer&lt;br /&gt;Comment=Oracle SQL Developer&lt;br /&gt;Icon=/opt/sqldeveloper/icon.png&lt;br /&gt;Exec=sqldeveloper&lt;br /&gt;Terminal=false&lt;br /&gt;Type=Application&lt;br /&gt;Categories=Development&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Пример содержимого файла для Data Modeller:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;[Desktop Entry]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Encoding=UTF-8&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Name=Oracle Data Modeler&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Comment=Oracle Data Modeler&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Icon=/opt/datamodeler/icon.png&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Exec=datamodeler&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Terminal=false&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Type=Application&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Categories=Development &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Я подготовил архив с уже готовыми файлами для меню, с файлом-иконкой высокого разрешения для SQL Developer и скриптом, который может положить всё необходимые файлы в нужные места за вас. Главное дайте текущему пользователю права на запись в папку /opt/sqldeveloper, либо запускайте от имени root. Скрипт называется install_menu.sh. Инструкция по пользованию скриптом находится в нём же.&lt;br /&gt;
Архив можно скачать по ссылке: &lt;a href=&quot;https://mega.co.nz/#!Q8NxCKTT!BK2ynySNbJRwvb3ba-yMq2IhL0JDw7V7BKYA_zb3ecI&quot;&gt;https://mega.co.nz/#!Q8NxCKTT!BK2ynySNbJRwvb3ba-yMq2IhL0JDw7V7BKYA_zb3ecI&lt;/a&gt; (10 KB) &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;Важно!!!&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;Первый запуск приложения должен быть произведён из консоли, т.к. программа попросит указать месторасположение JVM.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/6982315618426661619/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2013/02/oracle-sql-developer-oracle-sql.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/6982315618426661619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/6982315618426661619'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2013/02/oracle-sql-developer-oracle-sql.html' title='Установка Oracle SQL Developer и Oracle SQL Developer Data Modeller на *.deb дистрибутив'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-569918877120967113</id><published>2012-10-21T06:13:00.003-07:00</published><updated>2012-10-21T06:13:54.301-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle 11g"/><title type='text'>Внешние таблицы + препроцессор</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&amp;nbsp; &amp;nbsp; Эту заметку пишу в качестве узелка на память.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Дело в ом, что я уже довольно давно знаю о существовании в Oracle внешних таблиц. Очень удобного средства для перекидывания данных из CVS файлов в базу. Но только сегодня я узнал о существовании в Oracle 11.2 препроцессора, который может подготавливать данные для внешней таблицы посредством выполнения каких-либо программ на машине, где работает сервер базы данных.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Ниже даю ссылки на описание работы с внешними таблицами и документ, в котором на основании простых примеров рассказывается как пользоваться препроцессором:&lt;br /&gt;
&lt;a href=&quot;http://docs.oracle.com/cd/E11882_01/server.112/e16536/et_concepts.htm&quot;&gt;Внешние таблицы&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://download.oracle.com/otndocs/products/database/enterprise_edition/utilities/pdf/xtables_preproc11g_1009.pdf&quot;&gt;Использование препроцессора с внешними таблицами&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/569918877120967113/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2012/10/blog-post.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/569918877120967113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/569918877120967113'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2012/10/blog-post.html' title='Внешние таблицы + препроцессор'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-1403949419046261958</id><published>2012-09-11T02:20:00.003-07:00</published><updated>2012-09-11T02:20:43.046-07:00</updated><title type='text'>Функция LISTAGG</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Чтобы &quot;вытянуть&quot; значение нескольких строк одной колонки в одну строку в Oracle 11.2 не обязательно придумывать хитрые иерархические запросы. Достаточно воспользоваться функцией &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;LISTAGG&lt;/b&gt;&lt;/span&gt;.&lt;br /&gt;
Вот её описание в документации Oracle:&amp;nbsp;&lt;a href=&quot;http://docs.oracle.com/cd/E14072_01/server.112/e10592/functions087.htm&quot;&gt;http://docs.oracle.com/cd/E14072_01/server.112/e10592/functions087.htm&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/1403949419046261958/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2012/09/listagg.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/1403949419046261958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/1403949419046261958'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2012/09/listagg.html' title='Функция LISTAGG'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-5000068301379913497</id><published>2012-08-15T22:44:00.004-07:00</published><updated>2012-08-15T22:44:44.842-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="PL/SQL"/><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This is a copy of&amp;nbsp;http://asktom.oracle.com/~tkyte/Misc/RolesAndProcedures.html&lt;br /&gt;
&lt;h1&gt;
Why do I get a &quot;ORA-01031: insufficient privileges&quot; or &quot;PLS-00201: identifier &#39;x&#39; must be declared&quot; in my stored procedures?&lt;/h1&gt;
Roles are never enabled during the execution of a procedure except in the special case of Invokers Rights which is a new feature in Oracle8i, release 8.1.This fact is documented application developers guide:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;b&gt;&lt;i&gt;Privileges Required to Create Procedures and Functions&lt;/i&gt;&lt;/b&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;To create a stand-alone procedure or function, or package specification or&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;body, you must meet the following prerequisites:&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;• You must have the CREATE PROCEDURE system privilege to create a&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;procedure or package in your schema, or the CREATE ANY&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;PROCEDURE system privilege to create a procedure or package in&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;another user’s schema.&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;Attention: To create without errors, that is, to compile the procedure&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;or package successfully, requires the following additional privileges:&lt;/i&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;The owner of the procedure or package must have been explicitly&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;granted the necessary object privileges for all objects referenced within&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;the body of the code&lt;/b&gt;; the owner cannot have obtained required&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;privileges through roles.&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;If the privileges of a procedure’s or package’s owner change, the procedure&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;must be reauthenticated before it is executed. If a necessary privilege to a&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;referenced object is revoked from the owner of the procedure (or package), the&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;procedure cannot be executed.&lt;/i&gt;&lt;/blockquote&gt;
&amp;lt;/quote&amp;gt;Try this:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;tt&gt;SQL&amp;gt; set role none;&lt;/tt&gt;&lt;br /&gt;
&lt;tt&gt;SQL&amp;gt; &quot;statement you want to test to see if it&#39;ll work in a procedure&quot;&lt;/tt&gt;&lt;/blockquote&gt;
&lt;div id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot;&gt;
&lt;br /&gt;
If you can do it in plus with no roles you can do it in a procedure.&amp;nbsp; If you can&#39;t, you must have the privelege from a role and hence won&#39;t be able to do it in a procedure (unless you are using Invokers rights in Oracle8i.&amp;nbsp; See the PLSQL documentation for more information on this feature and make sure you understand the ramifications).&amp;nbsp; To be able to perform that operation in a typical procedure, you need to have that privelege granted&amp;nbsp;&lt;b&gt;directly to you.&lt;/b&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/5000068301379913497/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2012/08/this-is-copy-of-why-do-i-get-ora-01031.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/5000068301379913497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/5000068301379913497'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2012/08/this-is-copy-of-why-do-i-get-ora-01031.html' title=''/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-3679024862492540845</id><published>2012-08-15T22:32:00.003-07:00</published><updated>2012-08-15T22:48:27.393-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="PL/SQL"/><title type='text'>Почему PL/SQL в коде (представлении/процедуре/триггере/пакете) невозможно использовать чужие объекты. Roles and ORA-00942 table or view does not exist</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; Этот вопрос находится в &lt;a href=&quot;http://www.sql.ru/forum/actualthread.aspx?bid=3&amp;amp;tid=212946&quot;&gt;топе вопросов на SQL.RU&lt;/a&gt; по СУБД Oracle.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; Краткий ответ такой, потому что грант на эти объекты выдан через роль.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; Ответ в документации по Oracle: &lt;a href=&quot;http://docs.oracle.com/cd/B28359_01/network.111/b28531/authorization.htm#i1007304&quot;&gt;&quot;Потмучто в&amp;nbsp;именованном&amp;nbsp;PL/SQL блоке все роли отключаются&quot;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; Чуть более развёрнутый ответ приведён на самом SQL.RU:&amp;nbsp;&lt;u style=&quot;background-color: #eeeeee; color: #222222; font-size: 13px;&quot;&gt;Почему в своем pl/sql-коде (представлении/процедуре/триггере/пакете) не удается использовать чужой объект - выдается ошибка&amp;nbsp;&lt;i&gt;ORA-00942 table or view does not exist&lt;/i&gt;&amp;nbsp;- хотя в sql-запросе или в анонимном pl/sql/блоке все нормально, обращение к объекту другого пользователя проходит без проблем?&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b style=&quot;background-color: #eeeeee; color: #222222; font-size: 13px;&quot;&gt;Ответ.&lt;/b&gt;&lt;span style=&quot;background-color: #eeeeee; color: #222222; font-size: 13px;&quot;&gt;&amp;nbsp;Скорее всего на чужой объект есть привилегия, выданная&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: #eeeeee; color: #222222; font-size: 13px;&quot;&gt;только через роль&lt;/b&gt;&lt;span style=&quot;background-color: #eeeeee; color: #222222; font-size: 13px;&quot;&gt;. Для использования объектов другого пользователя или системных привелегий в своих процедурах/триггерах и т.д., а также в job-ах необходимо дать на них&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: #eeeeee; color: #222222; font-size: 13px;&quot;&gt;привилегию напрямую&lt;/b&gt;&lt;span style=&quot;background-color: #eeeeee; color: #222222; font-size: 13px;&quot;&gt;, не через роль.&lt;/span&gt;&lt;br style=&quot;background-color: #eeeeee; color: #222222; font-size: 13px;&quot; /&gt;&lt;span style=&quot;background-color: #eeeeee; color: #222222; font-size: 13px;&quot;&gt;Так же это правило следует учесть для динамического SQL:&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.sql.ru/faq/faq_topic.aspx?fid=164&quot; id=&quot;&quot; style=&quot;background-color: #eeeeee; color: blue; font-size: 13px;&quot; target=&quot;_blank&quot;&gt;FAQ: ORA-01031: insufficient privileges при выполнении динамического SQL в процедурах&lt;/a&gt;&amp;nbsp;&lt;span style=&quot;font-size: x-small;&quot;&gt;(по этой ссылке приводится ещё более развёрнутый ответ)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Ну и самый подробный ответ на этот вопрос нам предлагает &lt;a href=&quot;http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1065832643319&quot;&gt;ASKTOM.ORACLE.COM&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Привожу перепечатку этого ответа, мало ли он исчезнет:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=7853996043734512777&quot; name=&quot;PAGETOP&quot; style=&quot;background-color: #eeeeee; font-family: arial, helvetica, sans-serif; font-size: 12px;&quot;&gt;&lt;table align=&quot;center&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; id=&quot;t18PageBody&quot; style=&quot;background-color: white; empty-cells: show; font-size: 9pt; height: 70%px; width: 80%px;&quot; summary=&quot;&quot;&gt;&lt;tbody style=&quot;font-size: 9pt;&quot;&gt;
&lt;tr style=&quot;font-size: 9pt;&quot;&gt;&lt;td height=&quot;100%&quot; id=&quot;t18ContentBody&quot; style=&quot;border-collapse: collapse; empty-cells: show; font-size: 1em;&quot; valign=&quot;top&quot; width=&quot;100%&quot;&gt;&lt;table style=&quot;empty-cells: show; font-size: 9pt; width: 100%px;&quot;&gt;&lt;tbody style=&quot;font-size: 9pt;&quot;&gt;
&lt;tr style=&quot;font-size: 9pt;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; empty-cells: show; font-size: 1em;&quot; valign=&quot;top&quot; width=&quot;100%&quot;&gt;&lt;table style=&quot;empty-cells: show; font-size: 9pt; width: 100%px;&quot;&gt;&lt;tbody style=&quot;font-size: 9pt;&quot;&gt;
&lt;tr style=&quot;font-size: 9pt;&quot;&gt;&lt;td colspan=&quot;2&quot; style=&quot;border-collapse: collapse; empty-cells: show; font-size: 1em;&quot; valign=&quot;top&quot; width=&quot;100%&quot;&gt;&lt;div id=&quot;t18ContentMiddle&quot; style=&quot;font-size: 1em; padding: 0px 5px;&quot;&gt;
&lt;h2 id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;font-size: 1.05em; font-style: italic;&quot;&gt;
You Asked&lt;/h2&gt;
&lt;pre&gt;Hi Tom,

We are using 2 schemas, user1, user2.
User1 has user1_table, and created role role1. The following was issued:
grant select, insert, update, delete on user1_table to role1;
grant role1 to user2
User2 created private synonym user1_table for user1.user1_table
and tried to create :

create or replace procedure aa as
aa user1_table.column%TYPE;
begin
null;
end;
/
Warning: Procedure created with compilation errors.

SQL&amp;gt; show err
Errors for PROCEDURE AA:

LINE/COL ERROR
-------- -----------------------------------------------------------------
2/4      PLS-00201: identifier &#39;USER1.USER1_TABLE&#39; must be declared
2/4      PL/SQL: Item ignored

Why user2 cannot access user1_table in his procedure, if he has rights on the this table 
via role1?
We do not want to grant  user1_table to user2 directly.

Thanks,

Dusan

 &lt;/pre&gt;
&lt;br style=&quot;clear: both !important; font-size: 9pt;&quot; /&gt;
&lt;h2 style=&quot;font-size: 1.05em; font-style: italic;&quot;&gt;
and we said...&lt;/h2&gt;
&lt;pre&gt;See
&lt;/pre&gt;
&lt;pre id=&quot;&quot;&gt;&lt;a href=&quot;http://asktom.oracle.com/~tkyte/Misc/RolesAndProcedures.html&quot; id=&quot;&quot; style=&quot;color: #999999;&quot;&gt;http://asktom.oracle.com/~tkyte/Misc/RolesAndProcedures.html&lt;/a&gt;&lt;/pre&gt;
&lt;pre id=&quot;&quot;&gt;You have no choice but to grant select on user1_table to user2 directly.  It is the only 
way to make it work.

Why is it that roles are not used during the compilation of a procedure?  It has to do 
with the dependency model.  Oracle is not storing exactly WHY you are allowed to access T 
¡V only that you are (directly able to -- not via a role).  Any change to your privileges 
that might cause access to T to go away will cause the procedure to become invalid and 
necessitate its recompilation.  Without roles ¡V that means only ¡§REVOKE SELECT ANY 
TABLE¡¨ or ¡§REVOKE SELECT ON T¡¨ from the definers account or from PUBLIC.  With roles 
¡V it greatly expands the number of times we would invalidate this procedure.  If some 
role that was granted to some role that was granted to this user was modified, this 
procedure might go invalid, even if we did not rely on that privilege from that role.  
ROLES are designed to be very fluid when compared to GRANTS given to users as far as 
privilege sets go. For a minute, let¡¦s say that roles did give us privileges in stored 
objects.  Now, most any time anything was revoked from ANY ROLE we had, or any role any 
role we have has (and so on -- roles can and are granted to roles) -- many of our objects 
would become invalid. Think about that -- REVOKE some privilege from a ROLE and suddenly 
your entire database must be recompiled! 

Consider the impact of revoking some system privilege from a ROLE, it would be like doing 
that to PUBLIC now -- don&#39;t do it, just think about it (if you do revoke some powerful 
system privilege from PUBLIC, do it on a test database).  Revoking SELECT ANY TABLE from 
PUBLIC for example would cause virtually every procedure in the database to go invalid.  
If procedures relied on roles ¡V virtually every procedure in the database would 
constantly become invalid due to small changes in permissions.  Since one of the major 
benefits of procedures is the ¡§compile once, run many¡¨ model ¡V this would be 
disastrous for performance.

Also consider that roles may be

á Non-default: If I have a non-default role and I enable it and I compile a procedure 
that relies on those privileges, when I log out I no longer have that role -- should my 
procedure become invalid -- why? Why not? I could easily argue both sides.

á Password Protected: if someone changes the password on a ROLE, should everything that 
might need that role be recompiled?  I might be granted that role but not knowing the new 
password ¡V I can no longer enable it. Should the privileges still be available?  Why or 
Why not?  Again, arguing either side of this is easy.  There are cases for and against 
each.  

The bottom line with respect to roles in procedures with definers rights are:

á You have thousands or tens of thousands of end users. They don&#39;t create stored objects 
(they should not). We need roles to manage these people.  Roles are designed for these 
people (end users).

á You have far fewer application schema&#39;s (things that hold stored objects). For these 
we want to be explicit as to exactly what privileges we need and why.  In security terms 
this is called the concept of &#39;least privileges&#39; -- you want to specifically say what 
privilege you need and why you need it. If you inherit lots of privileges from roles you 
cannot do that effectively. We can manage to be explicit since the number of development 
schemas is SMALL (but the number of end users is large)...

á Having the direct relationship between the definer and the procedure makes for a much 
more efficient database.  We recompile objects only when we need to, not when we might 
need to.  It is a large efficiency enhancement.&lt;/pre&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/3679024862492540845/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2012/08/plsql-roles-and-ora-00942-table-or-view.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/3679024862492540845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/3679024862492540845'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2012/08/plsql-roles-and-ora-00942-table-or-view.html' title='Почему PL/SQL в коде (представлении/процедуре/триггере/пакете) невозможно использовать чужие объекты. Roles and ORA-00942 table or view does not exist'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-6215001791697794618</id><published>2012-08-09T21:44:00.000-07:00</published><updated>2012-08-09T21:44:00.069-07:00</updated><title type='text'>Чудесная функция COALESCE</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; Как всем известно в Oracle SQL есть замечательная функция NVL, которая позволяет вывести результат &quot;по умолчанию&quot;, в случае если значение колонки равно NULL.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; На протяжении всей своей оракловой жизни я успешно пользовался этой функцией, жил не тужил, хотя нет, иногда мне становилось грустно, когда мне надо было вывести в колонку значение которой надо было взять из других колонок, при этом оно не должно было быть NULL, если все колонки равны NULL, то надо было вывести значение по умолчанию. Обычно эту задачу я решал при помощи CASE, но это требовало много сил и писанины. А вчера произошло чудо, оказывается есть замечательная функция&amp;nbsp;&lt;span style=&quot;background-color: #eeeeee; color: #222222; font-size: 12px;&quot;&gt;&lt;b&gt;COALESCE&lt;/b&gt;, которая замечательно заменяет этот CASE, ниже привожу её синтаксис и пример из документации по Oracle.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee; color: #222222; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;pre class=&quot;oac_no_warn&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-color: #eeeeee; color: #222222; padding: 0.5ex 1ex;&quot; xml:space=&quot;preserve&quot;&gt;&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;COALESCE (expr1, expr2, ..., expr&lt;span class=&quot;italic&quot; style=&quot;font-style: italic;&quot;&gt;n&lt;/span&gt;), for &lt;span class=&quot;italic&quot; style=&quot;font-style: italic;&quot;&gt;n&lt;/span&gt;&amp;gt;=3&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;oac_no_warn&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-color: #eeeeee; color: #222222; font-size: 12px; padding: 0.5ex 1ex;&quot; xml:space=&quot;preserve&quot;&gt;&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;Пример:&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;oac_no_warn&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-color: #eeeeee; color: #222222; padding: 0.5ex 1ex;&quot; xml:space=&quot;preserve&quot;&gt;&lt;pre class=&quot;oac_no_warn&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;padding: 0.5ex 1ex;&quot; xml:space=&quot;preserve&quot;&gt;&lt;pre class=&quot;oac_no_warn&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;font-size: 12px; padding: 0.5ex 1ex;&quot; xml:space=&quot;preserve&quot;&gt;SELECT product_id, list_price, min_price,
   COALESCE(0.9*list_price, min_price, 5) &quot;Sale&quot;
   FROM product_information
   WHERE supplier_id = 102050
   ORDER BY product_id, list_price, min_price, &quot;Sale&quot;;

PRODUCT_ID LIST_PRICE  MIN_PRICE       Sale
---------- ---------- ---------- ----------
      1769         48                  43.2
      1770                    73         73
      2378        305        247      274.5
      2382        850        731        765
      3355                                5&lt;/pre&gt;
&lt;/pre&gt;
&lt;pre class=&quot;oac_no_warn&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;font-size: 12px; padding: 0.5ex 1ex;&quot; xml:space=&quot;preserve&quot;&gt;&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;oac_no_warn&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;font-size: 12px; padding: 0.5ex 1ex;&quot; xml:space=&quot;preserve&quot;&gt;&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;Синтаксис и пример взяты &lt;a href=&quot;http://docs.oracle.com/cd/B28359_01/server.111/b28286/functions023.htm&quot;&gt;документации по SQL СУБД Oracle&lt;/a&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/6215001791697794618/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2012/08/coalesce.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/6215001791697794618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/6215001791697794618'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2012/08/coalesce.html' title='Чудесная функция COALESCE'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-7867019905641930001</id><published>2012-04-27T05:32:00.001-07:00</published><updated>2012-04-28T04:58:29.896-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><title type='text'>Как поместить в одну ячейку значение нескольких столбцов</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Это скорее небольшая заметка, чем справочная информация.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Столкнулся я с такой проблемой, что надо было мне результат табличной функции представить в в одной ячейке и отделить каждое значение запятой. Самый здравый способ сделать это - функция на PL/SQL, но мы не ищем лёгких путей. Поэтому получилось вот такое:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;select text&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;from (select ltrim(sys_connect_by_path(col, &#39;, &#39;), &#39;, &#39;) as text, CONNECT_BY_ISLEAF is_leaf&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; from (select &amp;lt;имя колонки, для вытягивания в строку&amp;gt; as col,&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rownum as up_rnum,&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rownum+1 as rnum&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from table(&amp;lt;сюда помещаем нашу табличную функцию&amp;gt;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; start with up_rnum = 1&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; connect by prior rnum = up_rnum)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;where is_leaf = 1&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;UPD:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Оказывается всё уже придумано до нас :)))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;На просторах интернета нашёл статью, в которой приведено достаточно способов для вытягивания значения нескольких строк в одну ячейку. Исходник статьи здесь:&amp;nbsp;&lt;a href=&quot;http://www.oracle-base.com/articles/misc/string-aggregation-techniques.php&quot;&gt;http://www.oracle-base.com/articles/misc/string-aggregation-techniques.php&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Самый &quot;огонь&quot;, аналитическая функция, которая появилась в 11gR2 -&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt; LISTAGG&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Пример её использования:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-color: #f2f1f2; border-bottom-color: rgb(224, 224, 224); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(224, 224, 224); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(224, 224, 224); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(224, 224, 224); border-top-style: solid; border-top-width: 1px; font-size: 13px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: -webkit-auto;&quot;&gt;Base Data:

    DEPTNO ENAME
---------- ----------
        20 SMITH
        30 ALLEN
        30 WARD
        20 JONES
        30 MARTIN
        30 BLAKE
        10 CLARK
        20 SCOTT
        10 KING
        30 TURNER
        20 ADAMS
        30 JAMES
        20 FORD
        10 MILLER

Desired Output:

    DEPTNO EMPLOYEES
---------- --------------------------------------------------
        10 CLARK,KING,MILLER
        20 SMITH,FORD,ADAMS,SCOTT,JONES
        30 ALLEN,BLAKE,MARTIN,TURNER,JAMES,WARD&lt;/pre&gt;
&lt;pre id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-color: #f2f1f2; border-bottom-color: rgb(224, 224, 224); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(224, 224, 224); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(224, 224, 224); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(224, 224, 224); border-top-style: solid; border-top-width: 1px; font-size: 13px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: -webkit-auto;&quot;&gt;&lt;pre id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;border-bottom-color: rgb(224, 224, 224); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(224, 224, 224); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(224, 224, 224); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(224, 224, 224); border-top-style: solid; border-top-width: 1px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;COLUMN employees FORMAT A50

SELECT deptno, LISTAGG(ename, &#39;,&#39;) WITHIN GROUP (ORDER BY ename) AS employees
FROM   emp
GROUP BY deptno;

    DEPTNO EMPLOYEES
---------- --------------------------------------------------
        10 CLARK,KING,MILLER
        20 ADAMS,FORD,JONES,SCOTT,SMITH
        30 ALLEN,BLAKE,JAMES,MARTIN,TURNER,WARD

3 rows selected.&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/7867019905641930001/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2012/04/blog-post.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/7867019905641930001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/7867019905641930001'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2012/04/blog-post.html' title='Как поместить в одну ячейку значение нескольких столбцов'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-2483583657610533853</id><published>2011-12-26T21:13:00.000-08:00</published><updated>2011-12-26T21:13:00.115-08:00</updated><title type='text'>DBMS_ROWID</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; В Oracle существует замечательный пакет &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;DBMS_ROWID&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;, а замечателен он тем, что по rowid строки может рассказать всякую информацию о нет, в том числе и сведения, о том, в какой таблице она находится.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Подробности о функциях, содержащихся в пакете можно прочитать по ссылкам:&amp;nbsp;&lt;a href=&quot;http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_rowid.htm&quot;&gt;Oracle Doc&lt;/a&gt;&amp;nbsp;и&amp;nbsp;&lt;a href=&quot;http://psoug.org/reference/dbms_rowid.html&quot;&gt;PSOUG&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Есть тонкость в использовании самой ходовой, для меня, функции из этого пакета:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;oac_no_warn&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-color: white; text-align: -webkit-auto;&quot; xml:space=&quot;preserve&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;     &lt;b&gt;DBMS_ROWID.ROWID_OBJECT (rowid_id IN ROWID) RETURN NUMBER;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;oac_no_warn&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-color: white; text-align: -webkit-auto;&quot; xml:space=&quot;preserve&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;    Данная функция возвращает Id объекта, который содержит наш rowid, самым не очевидным моментом связанным с этой функцией является то, обстоятельство, что object id, который она возвращает для таблиц (по крайней мере в Oracle 11g) надо искать в  &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;user_objects&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt; или all_objects, не в поле &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;object_id&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;, а поле &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;data_object_id&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;.&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;oac_no_warn&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-color: white; text-align: -webkit-auto;&quot; xml:space=&quot;preserve&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;    Этот не самый очевидный момент заставлял меня несколько раз прерывать программирование и лазить в дебрях БД.&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/2483583657610533853/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2011/12/dbmsrowid.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/2483583657610533853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/2483583657610533853'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2011/12/dbmsrowid.html' title='DBMS_ROWID'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-6161496289140798891</id><published>2011-10-31T23:42:00.000-07:00</published><updated>2011-10-31T23:42:50.341-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle 11g"/><category scheme="http://www.blogger.com/atom/ns#" term="PL/SQL"/><title type='text'>Oracle Database 11g: Новые возможности в PL/SQL</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Для людей желающих прочитать про плюшки, которые есть в Oracle 11g рекомендую почитать этот документ. В нём представлен список новых фишек, которые есть в Oracle 11g&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;a href=&quot;http://www.dsvolk.ru/oracle/papers/11g_plsqlNF.pdf&quot;&gt;Oracle Database 11g: Новые возможности в PL/SQL&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Также есть замечательный вебсайт, но он на английском, где также можно прочитать о новых возможностях разных версий:&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.oracle-developer.net/index.php&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;oracle-developer.net&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/6161496289140798891/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2011/10/oracle-database-11g-plsql.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/6161496289140798891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/6161496289140798891'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2011/10/oracle-database-11g-plsql.html' title='Oracle Database 11g: Новые возможности в PL/SQL'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-4834778583028920760</id><published>2011-10-31T06:38:00.000-07:00</published><updated>2011-10-31T23:38:22.790-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PL/SQL"/><title type='text'>Динамический SQL</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; Порой случается, что надо чтобы код выполнял запрос, который заранее точно не известен, для решения таких задач в СУБД Oracle существует 3 способа решения данной задачи.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Здесь я только перечислю те решения, которыми мне доводилось пользоваться, подробности можно почерпнуть из документации Oracle.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;EXECUTE IMMEDIATE&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Наиболее часто используемый мной подход. После имени этой команды подаём строку с SQL запросом, которая немедленно выполняется. Для того, чтобы нас не считали неграмотными программистами используем bind переменные, которы позволяют избежать многократного распарсивания запроса. Также из &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;EXECUTE&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;IMMEDIATE&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt; можно возвращать данные при помощи &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;INTO&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt; и &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;BULK COLLECT INTO&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Подробная документация находится по этой ссылке:&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/dynamic.htm#BHCEBBAI&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/dynamic.htm#BHCEBBAI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;OPEN FOR&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Конструкция, которой я пользуюсь очень редко, т.к. обычно хватает способа под цифрой 1. По сути - это курсор, даже не знаю как его правильно назвать, явным или неявный. Дело заключается в том, что для того, чтобы воспользоваться данной командой необходимо создать курсорную переменную типа &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;REF CURSOR&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;. Далее работаем как и с обычными курсорами.&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Вот пример:&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;declare&lt;br /&gt;&amp;nbsp; &amp;nbsp; type t_cursor REF CURSOR;&lt;br /&gt;&amp;nbsp; &amp;nbsp; cursor t_sursor;&lt;br /&gt;&amp;nbsp; &amp;nbsp; num number;&lt;br /&gt;begin&lt;br /&gt;&amp;nbsp; &amp;nbsp; OPEN cursor FOR &#39;select 1 from dual&#39;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; fetch cursor into num;&lt;br /&gt;&amp;nbsp; &amp;nbsp; close cursor;&lt;br /&gt;end;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Пакет &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;DBMS_SQL&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Пакет очень мощный, но в тоже время не очевидный, чтобы с ним разобраться рекомендую почитать не только документацию по адресу:&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://download.oracle.com/docs/cd/E14072_01/appdev.112/e10577/d_sql.htm&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;http://download.oracle.com/docs/cd/E14072_01/appdev.112/e10577/d_sql.htm&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;, но и сайт на русском языке:&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://osql.ru/?p=111&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;http://osql.ru/?p=111&lt;/a&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Рекомендую обратить особое внимание на функции&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://download.oracle.com/docs/cd/E14072_01/appdev.112/e10577/d_sql.htm#CHDJDGDG&quot; style=&quot;background: inherit; color: #003399; text-decoration: underline;&quot;&gt;TO_CURSOR_NUMBER&lt;/a&gt;&amp;nbsp;и&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://download.oracle.com/docs/cd/E14072_01/appdev.112/e10577/d_sql.htm#CHDFDCDE&quot; id=&quot;&quot; style=&quot;background: inherit; color: #003399; text-decoration: underline;&quot;&gt;TO_REFCURSOR&lt;/a&gt;&amp;nbsp;, они помогают конвертировать курсор из&amp;nbsp;обычного формата в&amp;nbsp;DBMS_SQL формат и обратно.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/4834778583028920760/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2011/10/sql.html#comment-form' title='Комментарии: 1'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/4834778583028920760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/4834778583028920760'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2011/10/sql.html' title='Динамический SQL'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-4126742139341122129</id><published>2011-10-20T23:42:00.000-07:00</published><updated>2011-10-20T23:43:53.340-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DDL"/><category scheme="http://www.blogger.com/atom/ns#" term="DML"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><title type='text'>Primary key и триггер</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Поскольку с триггерами у меня мягко говоря не очень, а корпоративная политика гласит: &quot;Триггерами пользоваться сугубо в исключительных ситуациях, когда без них не обойтись&quot; - то изучать их в рабочем процессе не получается.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Но вопрос: &quot;&lt;b&gt;Как сделать&amp;nbsp;автоинкремент&amp;nbsp;primary key?&lt;/b&gt;&quot; - меня не отпускал, то я решил найденное решение записать в блог.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&amp;nbsp; &amp;nbsp; Итак, нам понядобятся:&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Таблица:&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;create table test (id number, testdata varchar2(255)); &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; white-space: pre;&quot;&gt;Последовательность:
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;create sequence test_seq 
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;start with 1 
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;increment by 1 
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;nomaxvalue; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; white-space: pre;&quot;&gt;И собственно говоря триггер, который будет создавать нам значение ключа:
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;create trigger test_trigger
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;before insert on test
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;for each row
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;begin
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;select test_seq.nextval into :new.id from dual;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;end;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;    После создания всех этих объектов нам достаточно выполнить:
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;insert into test(testdata) values(&#39;voila!&#39;);&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;    И наши данные будут без проблем добавлены.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;    Текст примеров взять с: &lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://jen.fluxcapacitor.net/geek/autoincr.html&quot;&gt;http://jen.fluxcapacitor.net/geek/autoincr.html&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/4126742139341122129/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2011/10/primary-key.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/4126742139341122129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/4126742139341122129'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2011/10/primary-key.html' title='Primary key и триггер'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-116884562078066282</id><published>2011-10-18T01:16:00.000-07:00</published><updated>2011-10-18T01:16:54.862-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><title type='text'>Индекс порождающий виртуальную колонку</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&amp;nbsp; &amp;nbsp; Я, да и не только я, всегда думал что всё что связано с индексами хранится где-то в недрах базы данных и Oracle скрывает от непосвящённых эти данные, но всё оказалось не так просто.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Только что наткнулся на очень интересную штуковину - виртуальную колонку, которую я не создавал. Когда начал разбираться выяснил, что индекс на базе функции может добавить в таблицу колонку, о существовании которой вы даже не догадывались.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; В моём случае на одну из колонок был повешен индекс такого вида:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;CREATE INDEX IE3_ADDR_DATA ON ADDR_DATA&amp;nbsp;(ADDR_ID ASC,&amp;nbsp;LOWER(VALUE) ASC)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; После этого при запросе к словарю данных&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;user_tab_cols&lt;/b&gt;&lt;/span&gt; видим колонку&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;SYS_NC00007$&lt;/b&gt;&lt;/span&gt;, которая в поле &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;DATA_DEFAULT&lt;/b&gt;&lt;/span&gt; содержит &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;LOWER(&quot;VALUE&quot;)&lt;/b&gt;&lt;/span&gt; и полу &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;VIRTUAL_COLUMN&lt;/b&gt;&lt;/span&gt; хранится значение &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;YES&lt;/b&gt;&lt;/span&gt;.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Будьте осторожны при чтении словарей данных и их использовании в обычной жизни.&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/116884562078066282/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2011/10/blog-post.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/116884562078066282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/116884562078066282'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2011/10/blog-post.html' title='Индекс порождающий виртуальную колонку'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-7577151316348237940</id><published>2011-08-31T00:47:00.000-07:00</published><updated>2011-08-31T00:47:15.884-07:00</updated><title type='text'>Сбор статистики по схеме</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444; font-family: &#39;Times New Roman&#39;; font-weight: normal; line-height: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;execute dbms_stats.gather_schema_stats (ownname =&amp;gt;&#39;USR&#39;,cascade =&amp;gt; TRUE);&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444; line-height: 16px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; padding-bottom: 1em; padding-left: 0pt; padding-right: 0pt; padding-top: 0em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Помимо&amp;nbsp;&lt;span id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;font-style: normal;&quot;&gt;&lt;b&gt;GATHER_SCHEMA_STATS&lt;/b&gt;&lt;/span&gt;, собирающей статистику по всей схеме, можно собирать статистику по отдельной таблице, индексу и т.п. Это может быть полезно, если требуется ускорить конкретный запрос (можно быстро собрать статистику только по конкретным таблицам). Вот полный список процедур сбора статистики из пакета DBMS_STAT:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul style=&quot;list-style-image: none; list-style-position: outside; list-style-type: none; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0pt; padding-top: 0pt; text-align: left;&quot;&gt;&lt;li style=&quot;list-style-type: none; margin-bottom: 0pt; margin-left: 15px; margin-right: 0pt; margin-top: 0pt; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;GATHER_INDEX_STATS&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;list-style-type: none; margin-bottom: 0pt; margin-left: 15px; margin-right: 0pt; margin-top: 0pt; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;GATHER_TABLE_STATS&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;list-style-type: none; margin-bottom: 0pt; margin-left: 15px; margin-right: 0pt; margin-top: 0pt; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;GATHER_SCHEMA_STATS&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;list-style-type: none; margin-bottom: 0pt; margin-left: 15px; margin-right: 0pt; margin-top: 0pt; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;GATHER_DATABASE_STATS&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li id=&quot;&quot; style=&quot;list-style-type: none; margin-bottom: 0pt; margin-left: 15px; margin-right: 0pt; margin-top: 0pt; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;GATHER_SYSTEM_STATS&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;Взято с :&amp;nbsp;&lt;a href=&quot;http://oraclenotes.ru/?p=65&quot;&gt;http://oraclenotes.ru/?p=65&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/7577151316348237940/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2011/08/blog-post.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/7577151316348237940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/7577151316348237940'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2011/08/blog-post.html' title='Сбор статистики по схеме'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-403028586260912248</id><published>2011-06-09T23:29:00.000-07:00</published><updated>2011-06-10T06:26:16.953-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PL/SQL"/><title type='text'>Индекс для контекстного поиска на основе функции</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 15px; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;В Oracle есть замечательная возможность осуществлять контекстный поиск по тексту, который в явном виде не хранится в таблице. Для того, чтобы воспользоваться этой возможностью необходимо написать функцию, которая по rowid целевой таблицы построит соответсвующую ей текстовую строку строку.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: transparent; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;background-color: transparent; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Прототип данной функции, или скорее процедуры, т.к. это процедура выглядит так:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;procedure ctx_foo(p_rid in rowid, p_ctx_text in out nocopy varchar2);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;p_rid&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; - rowid таблицы, в которой находятся данные, которые мы будем искать&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;p_ctx_text&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; - текст, который мы проиндексируем контекстным индексом для дальнейшего применения функции &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;CONTAINS&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Далее надо настроить контекстный индекс при помощи функций: создать perference в словаре Oracle при помощи процедуры &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;ctx_ddl.create_preference&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; и установить его атрибуты при помощи процедуры &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;ctx_ddl.set_attribute&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Теперь создаём контексный индекс, на любую колонку тип которой: &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;VARCHAR2, CLOB, BLOB, CHAR, BFILE, XMLType, URIType&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;create index &amp;lt;index_name&amp;gt; on &amp;lt;table_name(column_name) indextype is ctxsys.context parameters(&#39;&amp;lt;params&amp;gt;&#39;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Подробности про параметры можно прочитать по ссылке: &lt;/span&gt;&lt;a href=&quot;http://download.oracle.com/docs/cd/E11882_01/text.112/e16594/ind.htm#i1006887&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://download.oracle.com/docs/cd/E11882_01/text.112/e16594/ind.htm#i1006887&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Ниже я приведу пример создания контекстного индекса, у котрого строка для индексации генерируется процедурой.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Создаём таблицы и заполняем их исходными данными.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;create table ctx_source(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;grp number,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;word varchar2(32),&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;pos number);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_source values (1, &#39;Oracle&#39;, 1);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_source values (1, &#39;database&#39;, 2);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_source values (1, &#39;11g&#39;, 3);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_source values (2, &#39;Mary&#39;, 1);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_source values (2, &#39;had&#39;, 2);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_source values (2, &#39;a&#39;, 3);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_source values (2, &#39;little&#39;, 4);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_source values (2, &#39;lamb&#39;, 5);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_source values (3, &#39;Lamb&#39;, 1);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_source values (3, &#39;with&#39;, 2);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_source values (3, &#39;sauce&#39;, 3);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;create table ctx_foo (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;id number,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;ctx_text varchar2(1));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_foo(id) values (1);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_foo(id) values (2);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;insert into ctx_foo(id) values (3);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Создаём пакеты с функциями&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;create or replace &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;package ctx as &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;procedure ctx_foo(p_rid in rowid, p_ctx_text in out nocopy varchar2);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;function print_foo(p_id in number) &amp;nbsp;return varchar2;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;end ctx;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;create or replace&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;package body ctx as&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;procedure ctx_foo(p_rid in rowid, p_ctx_text in out nocopy varchar2)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;is&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;begin&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;for r in (select word&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&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;from ctx_source&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&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;where grp = (select id from ctx_foo where rowid = p_rid)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&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;order by pos)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;loop&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;p_ctx_text := p_ctx_text || r.word || &#39; &#39;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;end loop;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;p_ctx_text := rtrim(p_ctx_text);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;end ctx_foo;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;function print_foo(p_id in number) return varchar2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;is&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;l_return varchar2(256);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;begin&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;for r in (select word&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&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;from ctx_source&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&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;where grp = p_id&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&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;order by pos)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;loop&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;l_return := l_return || r.word || &#39; &#39;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;end loop;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;return rtrim(l_return);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;end print_foo;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;end ctx;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Создаём perference&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;exec ctx_ddl.create_preference( &#39;foo_datastore&#39;, &#39;user_datastore&#39; );&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;exec ctx_ddl.set_attribute(&#39;foo_datastore&#39;, &#39;procedure&#39;, &#39;ctx.ctx_foo&#39;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;exec ctx_ddl.set_attribute(&#39;foo_datastore&#39;, &#39;output_type&#39;, &#39;varchar2&#39;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Создаём индекс на основе нашего perference&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;create index index_ctx_foo on ctx_foo(ctx_text) &amp;nbsp;indextype is ctxsys.context parameters( &#39;datastore foo_datastore sync (on commit)&#39;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;/*sync (on commit) необходимо, чтобы индекс обновлялся автоматически при втавке новых данных, этот параметр не обязательный*/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Тестируем&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;select id, ctx.print_foo(id) from ctx_foo where contains(ctx_text,&#39;lamb&#39;) &amp;gt; 0;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;id &amp;nbsp;ctx.print_foo(id)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;Mary had a little lamb&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;3&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;Lamb with sauce&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;select id, ctx.print_foo(id) from ctx_foo where contains(ctx_text,&#39;oracle&#39;) &amp;gt; 0;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;id &amp;nbsp;ctx.print_foo(id)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;1 &amp;nbsp;&amp;nbsp;Oracle database 11g&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Желаю успешно использовать в своей работе контекстный индексы. У Oracle есть целый гайд работе с Oracle Text, прочитать его можно по адресу: &lt;/span&gt;&lt;a href=&quot;http://download.oracle.com/docs/cd/E11882_01/text.112/e16594/toc.htm&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://download.oracle.com/docs/cd/E11882_01/text.112/e16594/toc.htm&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/403028586260912248/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2011/06/blog-post_09.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/403028586260912248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/403028586260912248'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2011/06/blog-post_09.html' title='Индекс для контекстного поиска на основе функции'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-8794333630145505802</id><published>2011-06-01T07:44:00.001-07:00</published><updated>2011-06-01T22:45:46.525-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PL/SQL"/><title type='text'>Контекстный поиск</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: transparent; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span id=&quot;internal-source-marker_0.27192733925767243&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Как-то столкнулся я с новой для меня задачей, реализовтаь контектный поиск внутри Oracle.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;На русском языке Google сходу выдаёт одну статью, которая конечно помогла мне, но в ней не было по шагам написано что надо сделать, чтобы всё заработало. поэтому здесь я будет краткая справка о том что делать и куда бежать. По сути - это будет пересказ оракловой статьи - &lt;/span&gt;&lt;a href=&quot;http://download.oracle.com/docs/cd/E11882_01/text.112/e16594/quicktour.htm#i1008362&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Getting Started with Oracle Text&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Добавляем пользователю, который будет работать с пакетом &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;ctx_ddl&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; роль &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;ctxapp&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;GRANT ctxapp TO myuser;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Дать нашему пользователю гранты на выполнение функций, которые находятся в пакетах, которые относятся к Oracle Text. Следующий код даст гранты на все пакеты OT.&lt;/span&gt;&lt;div style=&quot;background-color: transparent; font-family: &#39;Times New Roman&#39;; font-size: medium; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 12pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;GRANT EXECUTE ON CTXSYS.CTX_CLS TO myuser;&lt;br class=&quot;kix-line-break&quot; /&gt;GRANT EXECUTE ON CTXSYS.CTX_DDL TO myuser;&lt;br class=&quot;kix-line-break&quot; /&gt;GRANT EXECUTE ON CTXSYS.CTX_DOC TO myuser;&lt;br class=&quot;kix-line-break&quot; /&gt;GRANT EXECUTE ON CTXSYS.CTX_OUTPUT TO myuser;&lt;br class=&quot;kix-line-break&quot; /&gt;GRANT EXECUTE ON CTXSYS.CTX_QUERY TO myuser;&lt;br class=&quot;kix-line-break&quot; /&gt;GRANT EXECUTE ON CTXSYS.CTX_REPORT TO myuser;&lt;br class=&quot;kix-line-break&quot; /&gt;GRANT EXECUTE ON CTXSYS.CTX_THES TO myuser;&lt;br class=&quot;kix-line-break&quot; /&gt;GRANT EXECUTE ON CTXSYS.CTX_ULEXER TO myuser;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 15px; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Подготовка окончена, теперь переходим к созданию таблиц и заполнения их данными и строим индекс.&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Создаём таблицу:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;REATE TABLE docs (id NUMBER PRIMARY KEY, text VARCHAR2(200));&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Вставляем в таблицу данные:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;INSERT INTO docs VALUES(1, &#39;&amp;lt;HTML&amp;gt;California is a state in the US.&amp;lt;/HTML&amp;gt;&#39;);&lt;br class=&quot;kix-line-break&quot; /&gt;INSERT INTO docs VALUES(2, &#39;&amp;lt;HTML&amp;gt;Paris is a city in France.&amp;lt;/HTML&amp;gt;&#39;);&lt;br class=&quot;kix-line-break&quot; /&gt;INSERT INTO docs VALUES(3, &#39;&amp;lt;HTML&amp;gt;France is in Europe.&amp;lt;/HTML&amp;gt;&#39;);&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Строим индекс:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;CREATE INDEX idx_docs ON docs(text)&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&#39;FILTER CTXSYS.NULL_FILTER SECTION GROUP CTXSYS.HTML_SECTION_GROUP&#39;);&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 12pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 15px; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Теперь выполняем запрос:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;    SELECT SCORE(1), id, text FROM docs WHERE CONTAINS(text, &#39;France&#39;, 1) &amp;gt; 0;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;SCORE(1) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ID TEXT&lt;br class=&quot;kix-line-break&quot; /&gt;---------- ---------- ----------------------------------------&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3 &amp;lt;HTML&amp;gt;France is in Europe.&amp;lt;/HTML&amp;gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2 &amp;lt;HTML&amp;gt;Paris is a city in France.&amp;lt;/HTML&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Хочу заметить, что данный пример покрывает только наипростейший контекстный индекс и контекстный поиск. В следующем посте я напишу как создавать контекстный индекс, основанный на функции. Это гораздо полезней.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/8794333630145505802/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2011/06/blog-post.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/8794333630145505802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/8794333630145505802'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2011/06/blog-post.html' title='Контекстный поиск'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-5590481380363844476</id><published>2011-05-27T05:27:00.000-07:00</published><updated>2011-05-27T05:27:01.953-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>NetworkManager не включает беспроводную сетевую карту</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Этот пост не совсем про Oracle а про Fedora Linux, на основе которой строится Red Hat Enterprise Linux на базе которого строится Oracle Linux, на котором корпорация Oracle рекомендует разворачивать свою СУБД.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Вобщем симптомы проблемы следующие: после загрузки беспроводная сетевая карта не активна, попытки её включить ни к чему не приводят, она всё также остаётся в состоянии disable, а интерфейс в down, по dmesg мы видим следующее:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; [ 7632.355105] iwlagn 0000:03:00.0: PCI INT A disabled&lt;br =&quot;1&quot;=&quot;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[ 7681.733032] iwlagn: Intel(R) Wireless WiFi Link AGN driver for Linux, in-tree:d&lt;br =&quot;1&quot;=&quot;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[ 7681.733035] iwlagn: Copyright(c) 2003-2010 Intel Corporation&lt;br =&quot;1&quot;=&quot;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[ 7681.733114] iwlagn 0000:03:00.0: PCI INT A -&amp;gt; GSI 17 (level, low) -&amp;gt; IRQ 17&lt;br =&quot;1&quot;=&quot;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[ 7681.733124] iwlagn 0000:03:00.0: setting latency timer to 64&lt;br =&quot;1&quot;=&quot;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[ 7681.733239] iwlagn 0000:03:00.0: Detected Intel(R) WiFi Link 5100 AGN, REV=0x54&lt;br =&quot;1&quot;=&quot;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[ 7681.754617] iwlagn 0000:03:00.0: device EEPROM VER=0x11f, CALIB=0x4&lt;br =&quot;1&quot;=&quot;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[ 7681.754619] iwlagn 0000:03:00.0: Device SKU: 0Xb&lt;br =&quot;1&quot;=&quot;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[ 7681.754643] iwlagn 0000:03:00.0: Tunable channels: 13 802.11bg, 24 802.11a channels&lt;br =&quot;1&quot;=&quot;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[ 7681.754719] iwlagn 0000:03:00.0: irq 46 for MSI/MSI-X&lt;br =&quot;1&quot;=&quot;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[ 7681.759905] iwlagn 0000:03:00.0: loaded firmware version 8.83.5.1 build 33692&lt;br =&quot;1&quot;=&quot;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[ 7681.760899] ieee80211 phy1: Selected rate control algorithm &#39;iwl-agn-rs&#39;&lt;br =&quot;1&quot;=&quot;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[ 7717.265118] ADDRCONF(NETDEV_UP): wlan0: link is not ready&lt;br =&quot;1&quot;=&quot;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[ 7718.948245] ADDRCONF(NETDEV_UP): wlan0: link is not ready&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
Причина проблемы в модуле ядра acer_wmi, его надо отправить в blacklist и всё чудесным образом заработает.&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;If Network Manager do not enable your wireless card and you dmesg log look like log on top, just insert module &quot;acer_wmi&quot; into blacklist.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/5590481380363844476/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2011/05/networkmanager.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/5590481380363844476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/5590481380363844476'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2011/05/networkmanager.html' title='NetworkManager не включает беспроводную сетевую карту'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-602908517839173665</id><published>2011-05-24T11:50:00.000-07:00</published><updated>2011-05-24T11:51:16.209-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle 10g"/><category scheme="http://www.blogger.com/atom/ns#" term="PL/SQL"/><title type='text'>Расширенные функции Oracle 10g по работе со стеком ошибок</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span id=&quot;internal-source-marker_0.42752690693191686&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; В Oracle 10g возможности для работы со стеком ошибок были расширены. В пакете &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;DBMS_UTILITY&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; появились функции, которые позволяют получить больше информации о том, как ведёт себя программа в случае возникновения исключительной ситуации.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Вот эти функции: &lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;FORMAT_ERROR_BACKTRACE - позволяет получить строку из программы, в которой произошла исключительная &amp;nbsp;ситуация&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;FORMAT_CALL_STACK&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; - отображает на экране стэк программы на момент возникновения исключения.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;FORMAT_ERROR_STACK&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; позволяет получить “полное” сообщение об ошибке (дело в том, что привычная всем функция &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;SQLERRM&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; имеет ограничение на длину выводимого текста 512 символов, новая функция имеет ограничение в 2000 символов).&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;Самый простой пример, который демонстрирует работу этих функций выглядит так:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;DECLARE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;local_exception EXCEPTION;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FUNCTION nested_local_function&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RETURN BOOLEAN IS&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;retval BOOLEAN := FALSE;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BEGIN&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RAISE local_exception;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RETURN retval;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BEGIN&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IF nested_local_function THEN&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbms_output.put_line(&#39;No raised exception&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END IF;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;EXCEPTION&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHEN others THEN&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbms_output.put_line(&#39;DBMS_UTILITY.FORMAT_CALL_STACK&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbms_output.put_line(&#39;------------------------------&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbms_output.put_line(dbms_utility.format_call_stack);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbms_output.put_line(&#39;DBMS_UTILITY.FORMAT_ERROR_BACKTRACE&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbms_output.put_line(&#39;-----------------------------------&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbms_output.put_line(dbms_utility.format_error_backtrace);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbms_output.put_line(&#39;DBMS_UTILITY.FORMAT_ERROR_STACK&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbms_output.put_line(&#39;-------------------------------&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbms_output.put_line(dbms_utility.format_error_stack);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Если его выполнить, то получим:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;DBMS_UTILITY.FORMAT_CALL_STACK&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;----- PL/SQL Call Stack -----&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;object &amp;nbsp;&amp;nbsp;&amp;nbsp;line &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;object&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;handle &amp;nbsp;&amp;nbsp;&amp;nbsp;number &amp;nbsp;&amp;nbsp;name&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;20909240 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;18 &amp;nbsp;&amp;nbsp;anonymous block&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;DBMS_UTILITY.FORMAT_ERROR_BACKTRACE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;-----------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;ORA-06512: at line 7&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;ORA-06512: at line 11&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;DBMS_UTILITY.FORMAT_ERROR_STACK&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;-------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;ORA-06510: PL/SQL: unhandled user-defined exception&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Скорее всего, самой востребованной функцией будет - &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Courier New; font-size: 11pt; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;DBMS_UTILITY.FORMAT_ERROR_BACKTRACE&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;,&amp;nbsp; рекомендую ознакомиться с более интересным примеров стека ошибок на сайте документации по Oracle 10g: &lt;/span&gt;&lt;a href=&quot;http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_util.htm#i1003874&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_util.htm#i1003874&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/602908517839173665/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2011/05/oracle-10g.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/602908517839173665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/602908517839173665'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2011/05/oracle-10g.html' title='Расширенные функции Oracle 10g по работе со стеком ошибок'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-1849117410270584041</id><published>2011-05-19T05:12:00.000-07:00</published><updated>2011-05-19T22:15:12.778-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle 11g"/><title type='text'>PIVOT и UNPIVOT в Oracle 11g</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;В Oracle 11g появились новые функции, которые позволяют разворачивать таблицу. Здесь я приведу пример для быстрого понимания того, как это работает, в конце статьи дам ссылку на чуть более подробное объяснение того как это работает.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: transparent;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;PIVOT&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; берёт данные из строк, аггрегирует их и возвращает в виде столбцов, иначе говоря, строит сводную таблицу.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;В качестве примера берём классику жанра, таблицу &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;emp&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; из схемы scott&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f9f9f9; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Сделаем разворот этой таблицы, чтобы получить сумму зарплат разбитую по должностям и департаментам:&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Строим таблицу суммы заплат по должностям и департаментам, которую потмо будем разворачивать&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f9f9f9; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SELECT job, deptno, sum(sal) sal FROM emp GROUP BY job, deptno&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;JOB           DEPTNO        SAL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;--------- ---------- ----------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;MANAGER           20       2975&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;PRESIDENT         10     &amp;nbsp;&amp;nbsp;5000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;CLERK             10     &amp;nbsp;&amp;nbsp;1300&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SALESMAN          30       5600&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;ANALYST           20       6000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;MANAGER           30       2850&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;MANAGER           10       2450&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;CLERK             30        950&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;CLERK             20       1900&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;    Внешний запрос строит сводную таблицу по должностям и департаментам, внутри функции &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;PIVOT&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, надо указать аггрегирующую функцию, и значения столбцов, по которым надо будет группировать данные&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f9f9f9; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SELECT *&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;FROM (SELECT job, deptno, sum(sal) sal FROM emp GROUP BY job, deptno)&lt;br class=&quot;kix-line-break&quot; /&gt;PIVOT ( sum(sal) FOR deptno IN (10, 20, 30, 40) );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;JOB               &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;; font-weight: bold; white-space: pre-wrap;&quot;&gt;10         20         30         40&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: transparent;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;--------- ---------- ---------- ---------- ----------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;CLERK           1300       1900        950&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SALESMAN                              5600&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;PRESIDENT       5000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;MANAGER         2450       2975       2850&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;ANALYST                    6000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;UNPIVOT&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; преобразует данные, разбитые по колонкам в данные разбитые по строкам.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Вот пример её работы:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;with t as (&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;select &#39;Oracle EE&#39; as product, 100 as Q1, 123 as Q2, 130 as Q3, 128 as Q4 from dual&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;union all&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;select &#39;Partitioning&#39;, 100, 123, 130, 128 from dual&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SELECT * FROM t&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;UNPIVOT INCLUDE NULLS (quantity_sold FOR quarter IN (Q1, Q2, Q3, Q4));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f9f9f9; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;PRODUCT &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;QUARTER QUANTITY_SOLD&lt;br class=&quot;kix-line-break&quot; /&gt;------------------------------ ------- -------------&lt;br class=&quot;kix-line-break&quot; /&gt;Oracle EE &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;Q1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;100&lt;br class=&quot;kix-line-break&quot; /&gt;Oracle EE &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;Q2 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;123&lt;br class=&quot;kix-line-break&quot; /&gt;Oracle EE &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;Q3 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;130&lt;br class=&quot;kix-line-break&quot; /&gt;Oracle EE &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;Q4 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;128&lt;br class=&quot;kix-line-break&quot; /&gt;Partitioning &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;Q1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;100&lt;br class=&quot;kix-line-break&quot; /&gt;Partitioning &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;Q2 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;123&lt;br class=&quot;kix-line-break&quot; /&gt;Partitioning &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;Q3 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;130&lt;br class=&quot;kix-line-break&quot; /&gt;Partitioning &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;Q4 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;128&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Для работы функции &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;UNPIVOT&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; требуется указать имена колонок, которые будут заполнена значениями из строк в нашем случае это &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;quantity_sold&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; и &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;quarter,&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; колоки, которые будут развёрнуты в строки указываются после &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;IN&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; это: &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Courier New&#39;; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Q1, Q2, Q3, Q4&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Больше информации по этим функциям можно прочитать: &lt;/span&gt;&lt;a href=&quot;http://www.oracle-base.com/articles/11g/PivotAndUnpivotOperators_11gR1.php&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://www.oracle-base.com/articles/11g/PivotAndUnpivotOperators_11gR1.php&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; и &lt;/span&gt;&lt;a href=&quot;http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#CHDFAFIE&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#CHDFAFIE&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/1849117410270584041/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2011/05/pivot-unpivot-oracle-11g.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/1849117410270584041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/1849117410270584041'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2011/05/pivot-unpivot-oracle-11g.html' title='PIVOT и UNPIVOT в Oracle 11g'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-5148599179547477326</id><published>2011-05-18T10:40:00.000-07:00</published><updated>2011-05-18T10:40:02.677-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Разное"/><title type='text'>Обращение к читателям</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Уважаемые читатели моего блога, если у вас есть какие-то вопросы по SQL или PL/SQL, то задавайте их в комментариях к любому посту или пишите мне на почту &lt;a href=&quot;mailto:queer82@gmail.com&quot;&gt;queer82@gmail.com&lt;/a&gt;. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; В мире программирования под Oracle есть много вопросов и проблем, так давайте находить решения на них вместе, это поможет нам узнать что-то новое.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/5148599179547477326/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2011/05/blog-post.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/5148599179547477326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/5148599179547477326'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2011/05/blog-post.html' title='Обращение к читателям'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7853996043734512777.post-5734150710759512022</id><published>2011-05-17T22:23:00.000-07:00</published><updated>2011-05-19T22:29:52.682-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PL/SQL"/><title type='text'>Конвейер из табличных (pipelined) функций</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Как-то раньше мне не приходилось сталкиваться с задачей, когда приходилось внутри одной табличной функции запрашивать данные из другой табличной функции в передавать их выше, но в конце концов этот момент настал.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Мне было необходимо перегрузить табличную функцию, а поскольку алгоритм обработки данных полностью повторял уже существующий я решил воспользоваться вызовом табличной функции.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Вроде бы всё просто, делай селект типа:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; for foo in (select * from pipelined_function(x))&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; loop&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pipe row (r.a, r.b, r.c ...);&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; end loop;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Но мне хотелось больше удобства, не хотел я писать кучу этих имён в &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;pipe row&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;, и начались поиски решения. Слава богу знаний хватило на то, чтобы прийти вот к такому решению:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Создаём типы:&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; create or replace type tr_mixed as object (num number, str varchar2(15));&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; create or replace type tt_mixed is table of tr_mixed;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Создаём &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;pipelined&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt; функцию, из которой в последствии будем получать данные:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; create or replace function pipe_func(p_iter number)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; return tt_mixed&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; pipelined&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; is&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; begin&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; for l_index in 1 .. p_iter&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; loop&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pipe row (tr_mixed(l_index, &#39;str-&#39; || l_index));&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end loop;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; end pipe_func;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; А теперь создаём &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;pipelined&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt; функцию, которая будет запрашивать данные из функции выше:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; create or replace&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; function pipe_func_ext&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; return tt_mixed&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; pipelined&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; is&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; l_temp_tt tt_mixed;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; begin&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; select cast(multiset (select * from table(pipe_func(10))) as tt_mixed)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; into l_temp_tt&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; from dual;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; for l_index in l_temp_tt.first .. l_temp_tt.last&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; loop&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pipe row (l_temp_tt(l_index));&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end loop;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; end pipe_func_ext;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Вся магия заключается в псевдофункции &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;MULTISET&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;, которая используется только 4как аргумент псевдофункции &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;CAST&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;.Она позволяет извлечь из базы данных набор значений и тут же преобразовать его в коллекцию нужного типа. Синтаксис у неё такой:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; select cast (multiset (select поле from таблица) as тип_коллекции) from dual&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Если всё равно не понятно, то код:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; select cast(multiset (select * from table(pipe_func(10))) as tt_mixed)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; into l_temp_tt&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; from dual;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; можно представить в виде:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; select tr_number(num, str)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; bulk collect into l_temp_tt&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; from&amp;nbsp;table(pipe_func(10));&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Только весь кайф заключается в том, что с &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;multiset&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;, можно писать &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;*&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Проверяем, что всё работает:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;select * from table(pipe_func_ext);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleinrussian.blogspot.com/feeds/5734150710759512022/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://oracleinrussian.blogspot.com/2011/05/pipelined.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/5734150710759512022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7853996043734512777/posts/default/5734150710759512022'/><link rel='alternate' type='text/html' href='http://oracleinrussian.blogspot.com/2011/05/pipelined.html' title='Конвейер из табличных (pipelined) функций'/><author><name>Dm4ik</name><uri>http://www.blogger.com/profile/18094158063553043174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>