Recently, I had to concatenate and put in one line (comma separated) the results of a query in Oracle. After one version using replace, xmlagg and xmlelement which had several problems and some reading online I compiled the following code: select rtrim(dbms_xmlgen.convert(xmlagg(xmlelement(e, mycolumn || ', ')).extract('//text()').getClobVal(), 1), ', ') from mytable The extract/getClobVal trick came from "ORA-19011 Character string buffer too small when used with XMLAGG function": http://oracle.ittoolbox.com/groups/technical-functional/oracle-dev-l/ora19011-character-string-buffer-too-small-when-used-with-xmlagg-function-3882635 The dbms_xmlgen.convert trick came from "HOWTO: Avoid Conversion of Escape Codes": http://www.liberidu.com/blog/?p=635 Enjoy :-)
We live in our Universe. We all study it and learn about it so that we can live in it. Human civilization systematized all knowledge into sciences like mathematics (from Greek: learning , study , science ), physics (from Greek: nature ), biology, chemistry, etc. The system of sciences is helping us understand where we are, but it is also enabling us to influence the World. The result? We have the Universe and our tiny, dense information structure called sciences. The Universe is "building" the sciences through us and gets influenced by the sciences through us. You can call the sciences, one dimension of our contribution as a society. You can also call the sciences a living organism that moves around and interacts with its environment. Here is an ugly sketch of the pyramid of influences: All the dots are in the Universe. The black ones are the inanimate objects. The red ones are the people on Earth. The blue ones are the objects of science. What is interesting to note here i...
1. Не става само с ядене, трябва и акъл! Познатата ни фраза от рекламата на една банка е много добро начало за тази статия. Турската дума "акъл" е навлязла в разговорната реч и означава няколко неща: ум, разум, разсъдък, съвет. Хората сме уникални с това колко добре (според нас) си служим с нашия ум. Докато бездомните кучета и котки, които се навъртат около нас, главно използват главата си, за да си набавят достатъчно храна да преживяват, човешкия ум неспирно работи за някаква по-висша цел, с известни изключения разбира се. Каква е разликата според науката? Главната причина за разлика в интелекта между нас и другите бозайници е, че ние просто имаме по-голям мозък. И както добре знаете от Мечо Пух: Колкото повече, толкова повече! Тук е необходимо да се поясни, че най-важна за интелекта на един бозайник е външната част от мозъка, която се нарича мозъчна кора (познатите ни мозъчните гънки или сиво вещество). Тя също така е и най-новата, от еволюционна гледна точка, част на на...
Comments
Post a Comment