Tuesday, March 24, 2009

Extract Day, Hour, Time from Date Datatype in Oracle

There was a need to write a query which would give output for data which took place between two specific hours in a day, in a particular a month, for a set of departments.

Set of departments - group by function
for a month - simple between and to_date conversion

for specific hours, day, time - Extract function

Extract(year from to_timestamp(to_char(column_name,'dd-Mon-yyyy HH:MI:SS AM')))
Extract(month from to_timestamp(to_char(column_name,'dd-Mon-yyyy HH:MI:SS AM')))
Extract(day from to_timestamp(to_char(column_name,'dd-Mon-yyyy HH:MI:SS AM')))

Extract(hour from to_timestamp(to_char(column_name,'dd-Mon-yyyy HH:MI:SS AM')))
Extract(minute from to_timestamp(to_char(column_name,'dd-Mon-yyyy HH:MI:SS AM')))
Extract(sec from to_timestamp(to_char(column_name,'dd-Mon-yyyy HH:MI:SS AM'))) 

There was some bit of struggle in finding the correct format. If column is of the datatype DATE then, one has to to_char it. Without to_charing it, it invariably returns only 0 (zero)

Extract Day, Hour, Time from Date Datatype in OracleSocialTwist Tell-a-Friend
Bookmark and Share

Download Flash in Firefox, without any software

One can download Flash or for that matter any media element in a webpage when viewed in Firefox, without any additional tool, or software or add-on to Firefox. How?
Well, say there is a flash file (Shockwave File with extension .swf) on a webpage and you want to download it. Then,
  • Open that particular webpage
  • Click on Tools in the top Menu bar
  • Then, from the list of options, click on Page Info. This option is one of the least explored option in Firefox. It gives all the information about the current web page that is open in Firefox.
  • Go to the second tab - Media
  • Under Address heading, it will show the location of the flash media object
  • Below, on the same screen, there would be an option as Save As..., using which one can save the flash as it is from the webpage!
Ofcourse, this is useful when one wants to download only one Flash file from a webpage. Plus, one has to open the webpage where this Flash would be 'active'. If there are only links to Flash objects on a webpage, one cannot download them. Media info does not show them as part of flash objects, but as image objects.
If one needs to download multiple flash objects from a webpage, then one can download softwares which do this work for us.
P.S: Interestingly, found a site which details multiple ways of tweaking FF and IE to download flash objects.

Download Flash in Firefox, without any softwareSocialTwist Tell-a-Friend
Bookmark and Share

Firefox Add-ons

Finally, this post has become a reality. I had mentioned in an earlier post that soon there would be a post on my favourite add-ons from firefox. There would surely be more than these, but currently these Add-ons are actively decorating my Firefox. In Firefox's own words:

"You spend more time online than on the road, but you probably think more about avoiding traffic than enjoying the best of the Web.
So, why not customize your Firefox for the things you really love to do? Take your browser from simple to spectacular.
Firefox add-ons are little extras that allow you to add a personal touch to your browser. Select your favorites from the categories to accessorize your Web!"

So, here is the list of 9 add-ons for firefox:
Hope you would find them useful, as much as I enjoyed in finding them and trying them out.

Update: Forgot to add one more add-on - PDF Convertor - convert any webpage into a pdf then and there.

Firefox Add-onsSocialTwist Tell-a-Friend
Bookmark and Share
Blog Widget by LinkWithin
 
Clicky Web Analytics