Oracle XML Nested Elements

I recently encountered a request to generate XML in one select query in Oracle to address the problem on the Cartesian table on the query created by another developer. It also addresses the additional overhead from the java program that transforms the data. As we know, Oracle has a number of handy xml functions that can help us do this requirement. For this particular requirement, it’s something new in such a way that it is nested XML beyond the second level. I’ve created queries for similar requests previously but I never did a nested data.

Continue reading


Oracle Sequence Skipping Numbers

Ever wonder why there are missing numbers when you get the NEXTVAL of the oracle sequence? We’ll it turns out that the sequence cache is affecting this. Basically, your session is assigned with a range of numbers, say 20(default). So when you logout of your session and then login and hit the sequence again, you’ll have a gap of 20.
Continue reading

SQLLDR – Error Field in data file exceeds maximum length

One of our migration consultants is asking our Siebel Administrator as to why his sqlldr is not working as expected. I pitched in because I thought the problem is interesting. His problem seems trivial as he’s just trying to load a rather long string from his text file into a varchar2 field with a length of 1000. However, one of his records gets rejected even with only 340 characters in his input data.
Continue reading

Ora Error ORA-01422 – Exact Fetch Return More Than One

I got the error below recently and it’s quite new to me. One of the sites I usually visit for more details states that it’s an Oracle bug. But I am sure that the problem is on the script I was running and as explained in the site, the bug is more on the Oracle not displaying the correct problem. That makes this problem more difficult to trace.

ORA-01422: exact fetch returns more than one requested number of rows

Continue reading

Install jpegoptim in CentOS

If you’re an adsense publisher, you might have noticed the scorecard the middle-right side of the Adsense screen. It gives us valuable insight on how to improve the performance of our website. and one of the persistent Red flag I see for the sites I manage is the image optimization problem. Fortunately, Google is not just showing you the problem because they also throw some recommenddations to address the problem.
Continue reading

Windows 7 Bug on Single and Double Quotes

My desktop machine at the office got migrated to Windows 7 and I started having problem with quotes (both " and '). It requires me to press twice before the quotes are displayed. I said quotes because it will print out two quotes in the screen instead of just 1!!! It’s too annoying given that I use it gazillion times everyday and I am forced to do multiple keystrokes just to display one damn quote! Take note that it does not happen on my Windows 7 laptop, only the desktop. It’s too frustrating especially so that it hampers my productivity.
Continue reading

Retrieve Bloomberg Data in Google Docs

So, one of my friends asked me if I can help him with this google doc spreadsheet he uses to track his stock portfolio. He only have 7 stocks right now but he finds it cumbersome to update the current price one by one so he’s thinking there might be a way to update the price automagically. In that way, he can immediately see how his stocks are doing for the day. I know google docs allows some kind of scripting and in-cell commands to retrieve information from the outside world.
Continue reading