Sunday, October 6, 2013

Thursday, July 25, 2013

The great Indian game Tambola Ticket using Apex

I like to write games. I wrote my first complete and functional  game using C language for playing Tennis way back at 1997.  Still remember all those code 

#include

void main(void) {
     detectgraph();
     initgraph();
}

The above code was named as sona.c (named after my pet cat named Sona) with some 1000+ lines written in turboC compiler. The PC used for building this code is 200 Mhz :) Intel Machine. The reason for building this game is, the institute never allowed to bring in Game or any exe files for playing because of the great risk of Virus. This restriction made me to write my own game so none will question me or even if they delete the .exe had the .c file to compile and build .exe again and again :) and also shared the game every student whom i know :). 

That's a big Story :), Story Apart.

Thought of building something with Apex for Games, rather you can say fun with PL/SQL for building games. Then i thought about the great Indian game called tambola ticket where ticket will be given to customers with random numbers between 1 and 100 and they need to mark the number which is called by the organizer. The guy who gets all the numbers first will win certain prize. 

I built the same game using Apex and is available here http://apex.oracle.com/pls/apex/f?p=39905:TICKET
The game was used by some of my friends and also used by one of the top IT Company internally for their employee club event.

This is just a beginning and there is no limit with Apex & PL/SQL...

Wednesday, May 29, 2013

Trick to sort Apex Calendar data based on any Column of choice

At present the Apex Calendar does override the column sort added to the SQL statement by the Date column used.

There is a trick to override this functionality, you need to modify your SQL statement to achieve the same.

select display_column, cast(date_column as timestamp) +  numtodsinterval('0.00' || rownum,'SECOND') date_column, sort_column 
from 
(select display_column, date_column, sort_column 
 from your_table 
 order by sort_column desc)

In the above example the Calendar data will be sorted on sort_column in a descending order.