16 February 2013

APEX: Using the Application Date Format Mask

In your APEX application, you can define several default format mask to be used throughout the application, such as the Application Date Format or the Application Date Time Format. This eliminates the need to specify the format mask for each Date Picker item that you use. It helps in keeping the application at least consistent regarding the format mask used.

When you want to do some validation in your forms using the Dates entered by the enduser, you might have a need for the Application Date Format.
So instead of hard coding (using the same format mask as you entered):
to_date (:P1_DATE_PICKER, 'dd-mm-yyyy')
write it using the built-in Application Date Format mask. Problem is.... the built-in for the Application Date Format Mask is not documented. Thanks to a prompt reply by Joel Kallman via Twitter, use the following built-in:
to_date (:P1_DATE_PICKER, :APP_NLS_DATE_FORMAT)

04 January 2013

APEX: Highlight a Record in Report - with Dynamic Action

Yesterday I wrote a blog on how you can highlight a record in a report. That blogpost can be found here. Learco Brizzi posted a comment on a different way of accomplishing the same thing. And there are probably a number of other possibilities to implement the same requirement. In this blogpost I want to show you how to do the same with a Dynamic Action. Why would you want to choose for a Dynamic Action? This is a more efficient way because you don't need to refresh the page or the region.

03 January 2013

APEX: Highlight a Record in Report

Yesterday I read a question which was posted as a reply to an earlier blogpost. The orginal blogpost was about how to make a Report Row clickable, instead of just the Edit column. The question was: "How do I keep the clicked row highlighted so I can keep it as context information?" To see a working example of the requirement, check out this sample page In this blogpost I will provide a step-by-step way of doing just that.

21 December 2012

APEX: Dynamic Action in Interactive Report

Yesterday I was showing a colleague how to use a Dynamic Action in an Interactive Report to do an update on the underlying table. To get this to work prior to APEX 4 you would need to write some javascript on the page as well as an Application Process. Mostly I used the method described by Roel Hartman a number of years ago.
Want to take a look at a demo first before the steps to take to make it work? It's right here.

07 November 2012

ACED Nordic Tour 2012: 4 days, 4 countries

Can't believe it's almost two weeks ago.
Together with Mark Rittman, Carl Dudley, Sten Vesterli, and Tanel Poder, I was invited to join in for the ACED Nordic Tour.
During the Nordic Tour we visited Denmark, Sweden, Norway and Finland. Four countries in four days.
I knew it was going to be a busy week, but didn't expect to be exhausted when I got back home on Saturday.
On Monday I flew into Copenhagen, Denmark where I met up with Sten Vesterli and Ken Holmstykke Jensen from the Danish Oracle User Group. They were kind enough to show me around the city, Tivoli and the World Press Photo exhibit, all very enjoyable, thank you very much.
Tuesday was the day of the Danish Oracle User Group at the offices of Oracle Denmark. In Denmark I did two presentations: "Analytic Functions Revisited" and "Edition Based Redefinition". When all the sessions were done, and the beer started to come out, we had to go to the taxi and rush to the airport.
Wednesday was Stockholm in Sweden. The location was absolutely stunning, an old school building (so I was told), with grand staircases and high ceilings.
My session in Stockholm: "Who's Afraid of Analytic Functions?" and "Getting Started with APEX Plugin Development".
This time we really had to hurry to get to the airport, nearly losing Carl on the way the to the trains.
Thursday: Oslo. The board of the Oracle User Group Norway were kind enough to welcome us in the hotel with some food and drinks. A nice welcome after having had airport food for a few days. My sessions in Oslo: "Getting Started with APEX Plugin Development" and "Who's Afraid of Analytic Functions?"
Friday, the last day of the tour: Helsinki, Finland. The sessions that I did in Helsinki: "Getting Started with APEX Plugin Development" and "Solving Puzzles with SQL: Cheating when playing the game SET" . Even though my last name was spelled wrongly on the agenda, I can't really blame them - they are not the first. This time we didn't have to rush to the airport, at least not all of us. Mark and Tanel were flying out that day to go home.
Sten, Carl, and myself did stay an extra night in Helsinki so we could enjoy a very nice meal and some Finnish specialties (which all seem to include wodka).
Like I said before, on Saturday I was exhausted. Looking back at the tour I really enjoyed it. Wish I could see more of the countries than just the airport, but maybe some other time. Looking back at the tour, I really enjoyed it and was in good company.

Thanks to the user groups who invited us, and organizing the conferences. Special thanks to the Ace program for sponsoring.

17 October 2012

OOW 2012: Little things make me happy

Yesterday evening we had the annual "We went to OOW and this is what's new in the world we call Oracle" at AMIS. Starting around 5pm and ending around 10pm a lot of information was presented by several AMIS colleagues.
My contribution to the evening was (amongst others) a little bit of new features in SQL and PL/SQL, only a little bit as there is too much to cover in just 20 minutes.
It's the little things that make me happy. What is the little thing that I like?
When you define a table you can assign a default value to a column (here it comes) based on a sequence. Take a look at the following (taken from the presentation Tom Kyte did during OOW):
First a sequence is created, with the resounding name S. Next the table (named T) is created where the column X has a default based on the NEXTVAL of the sequence S.
Just to repeat the line of interest:
x int default s.nextval primary key
How cool is that?
No longer will you need to create a trigger to fill the column with the nextvalue from a sequence, you just declare it this way and you're done.
Maybe it's just syntactic sugar, I don't know (yet) and frankly I don't care. I like the fact that this feature makes it more declarative to populate the primary key (or any other column of course).
I'm happy.

02 October 2012

SQL Developer tip: Don't open the table

One of things I don't like about Oracle SQL Developer is that if you are browsing and clicking on tables, it can automatically open the table on the right side of the IDE.
There is a simple way to switch that off, just heard how to switch this feature off. Navigate to the Preferences settings:
Goto Database >> Objectviewer, and uncheck the tickbox labelled "Open Object on Single Click"
And that's it.