Skip to main content

Posts

Showing posts from October, 2008

Oracle - Rank Function Overview

Rank calculates the rank of a value in a group of values. Rows with equal values for the ranking criteria receive the same rank. Oracle then adds the number of tied rows to the tied rank to calculate the next rank. Therefore, the ranks may not be consecutive numbers. Consider the following Schema CREATE TABLE USER_TEST ( user_id numeric(12), first_name varchar2(32), last_name varchar2(32), age numeric(3), salary numeric(7) ); insert into user_test values(1, 'Pardeep', 'Kumar', 26, 20000); insert into user_test values(2, 'Raj', 'Sharma', 23, 15000); insert into user_test values(3, 'Jai', 'Singh', 30, 30000); insert into user_test values(4, 'Rana', 'Pratap', 32, 35000); insert into user_test values(5, 'Nakul', 'Gupta', 23, 16000); insert into user_test values(6, 'Ritu', 'Kumar', 22, 10000); insert into user_test values(7, 'Sita', 'Dikshit', 27, 22000); insert into user_test val

Learn to Play Keyboard

One day I started searching internet about the same thing, how to play keyboard, went through a number of sites, blogs etc.. etc. But finally i learned it on my own, yes dont get surprised this is truth, because most of the sites will just provide you information on keyboard notes etc. But none of them tell you what goes wrong that you dont end up with success in keyboard playing. Well I am sharing my experience here, along with a couple of steps which I hope will be really helpful to you. Please read it like a story not like a lesson about keyboard learning, this will make it easy for you to learn keyboard. Also, this is for those who are busy with their life but still want to lean to play keyboard. First and foremost thing: a) Keep your keyboard at a place, where you can see it, see it in the morning when you get up, see it easily when you go around in your home, dont dump it into an almirah or trunk, this helps, dont get surprised, because everytime you see it at the back of the min

MUSSOORIE - Queen of Hills

Well, it was just 15 days to long weekend of 2nd october 2008 and we started thinking where do we go this time. Tired up of my daily drive to Gurgaon from Delhi, I wanted to go to a relaxing place, after some searching, we freezed mussoorie because of the following reasons. a) Its easy to reach just 300 kms, and their is Dehradun Shatabdi which runs daily, and after dehradun you can get cabs. b) Its queen of hills, now I too beleive it. c) Very good hotels available on all the major sites. You can make a booking before you leave. d) Place to go around are very nearby, that reduces the travel you do on a vacations. These were my priorities and hence i freezed for mussoorie, next difficult question "Where to Say?", yes this was the most difficult, when i started giving thoughts initially, but then it because simpler when i have thought to my reason for the vacation "RELAX", so it became simple look out for a place away from crowds, I listed a few of them: a) Surbhi Re

Creating Image Thumbnails

When I started working on this initially, I started looking into open source tools for this, after spending couple of hours on open source tools I suddenly jumped into oracle site and was pleased to see a good support for image processing in oracle. Oracle provides support to create thumbnail of images stored as blob. Here is simplest way to create image thumbnails. Create a table that will store the original image and the thumbnail image content as blob. CREATE TABLE test_thumbnail ( id NUMERIC(12) PRIMARY KEY, image_content BLOB, thumbnail_content BLOB, ); Create a stored procedure that will update the thumbnail_content field after image is stored in the database. create or replace PROCEDURE IMAGE_THUMB_PROCEDURE (imgId IN NUMBER , imgAttribute IN varchar2) AS imageId integer := 0; verb varchar2(100); src_blob BLOB; dst_blob BLOB; BEGIN imageId := imgId; verb := imgAttribute; update test_thumbnail set thumbnail_content=empty_blob() where id = imageId; select image_content into src_bl