Thursday, 2 August 2012

Thursday Thought - A continuously wondrous age

Forget for a moment the Internet exists. Can you do that?

Recently when I was talking with my Dad, I suggested I'd love the opportunity to experience perhaps a week of the 1950's - just to try to comprehend what life was really like 50 years ago without the presumptions of today. This could really apply to many decades in history, some of which I think would really enable people to understand why certain achievements haven't been repeated because of the climate of the day (I'm thinking moon landing here...)

These thoughts were drifting through my head has I played with my new toy - a Samsung Galaxy 3. Compared with previous smart phones, this thing is quite big - the perspective shown with the pen here doesn't do it any justice. The screen alone is about the same size as the current iPhone.


In particular, I was having a look at the battery settings, and I took a screenshot because I was admiring the wealth of information provided in that 4.8in screen, and the technology it probably takes to obtain it.

From the top, I have a notification from my wife ready for me to make a move in our scrabble-esque game; a notification to update some applications; my alarm ready to wake me tomorrow; wifi action going on; battery percentage remaining; the time - and this is all in the top line.

I wonder what it takes to gather individual application data regarding battery usage!

Back to my opening line, imagine this device without the Internet - what would you have? Perhaps compare it to the first computer you ever owned (and I'm thinking people of at least my vintage here - remember Commodore 64 or perhaps an IBM XT using DOS 3.x)

I'd see myself holding in my hand a device that can take high quality photos; high definition video; operate various time keeping options; an alarm; a torch; calendar; diary; journal; book reader; road map; calculator; gaming device; audio player... oh, and a telephone!

I wonder what people from the '50s would think of a device that did all that, without even comprehending what all the features having Internet access can provide. Kudos to those in history who imagined a potential world. It's getting harder though - what are we going to have in the next few decades?

Regardless, sometimes I think we have to remember how lucky we are to have what we have.

Happy days,

Scott.

Thursday, 19 July 2012

Thursday Thought - Legacy errors

The other day I was writing a query for my Apex application and I required an outer join. In this case I decided to use the ANSI syntax, and out of habit I used a scalar subquery to reference an application item:

select col1, col2
from my_table a
left outer join my_other_table b
on a.id = b.id
and b.sub_id = (SELECT v('F_SUB_ID') FROM DUAL)


I received the following error, which was fair enough - but what I did not expect to see was a reference to what I presume to be Oracle V6.

ORA-01799: a column may not be outer-joined to a subquery

Cause: <expression>(+) <relop> (<subquery>) is not allowed.
Action: Either remove the (+) or make a view out of the subquery. In V6 and before, the (+) was just ignored in this case.
I don't suppose anyone is still on Oracle6 out there?!

Wednesday, 18 July 2012

Apex - closing modal page on escape

I've been making use of the Skillbuilders Modal Page plug-in a fair bit recently, and I thought I'd share this little ditty on closing the dialog when the escape button is pressed.

I set the event to Key Release, using the 'document' DOM object.

The JavaScript condition is set to 'event.which = 27' - the ASCII translation of the escape key.

Finally, the true action closes the window, passing nothing back to the calling page
javascript:window.parent.$(window.parent.document).apex_modal_page('close','');>

Inline images 1

Of course, aside from the action - the same event can be captured if you're listening for the escape key for whatever reason.

Hope it helps.

Thursday, 5 July 2012

Thursday's Thought - APEX 4.2

During a conversation with a colleague I had thought regarding potential release date for Oracle Application Express 4.2

I know this is really comparing apples to oranges, but at least it gives a ball park ;-)

APEX 4.1 early adopter was released in May last year.
http://joelkallman.blogspot.com.au/2011/05/application-express-41-early-adopter-1.html
... and was released in August.
http://dgielis.blogspot.com.au/2011/08/upgraded-to-apex-41-successfully.html

So perhaps we shall expect 4.2 in September? Perhaps we'll just see how things go... :-p

Update: It was released in mid-October - not bad for such a major release!

Scott

Wednesday, 4 July 2012

Oracle Apex Feature Requests

At the start of the year I posted my thoughts on how Application Express could be improved in 4.2

When I posted it as a forum entry on OTN I didn't expect the discussion to last half a year and run into 264 replies!

At some point someone suggested there should be a feedback Apex application like the SQL Developer Exchange.

Well now there is:
https://apex.oracle.com/pls/apex/f?p=55447:1

If you want to help steer the ship that is Oracle Application Express - this is the place to do it.


Friday, 22 June 2012

Oracle APEX 4.2 Early Adopter announced

I knew this would happen - I'm back from holidays, all ready to focus on my little side project, and the Oracle Apex team announces the early adopter for Apex 4.2

Before you even head over to https://apexea.oracle.com to check it out, I would suggest heading over and reviewing what's new. (And I guess I also say this because I'm getting Error occurred while painting error page: ORA-01403: no data found when I log in - remember, it's early adopter)
Update - not sure about this working in Firefox & not Chrome - I'll log it.

Some features that stood out for me as I read through:

  1. The debug API has changed names again - apex_debug - synonyms set for backwards compatibility though
  2. After first attempt at Data Upload, it seems they've given it a good review
  3. I'm spotting various security improvements, always good to see little holes tidied up
  4. Number of items limit on page increased from 100 to 200
  5. Naming branches
  6. jQuery mobile & other mobile development preparations
  7. Drag and drop functionality is gone
  8. Asynchronous dynamic actions
  9. Non-flash charts for mobile
  10. Slider item
  11. Various IR improvements
So hopefully I'll be able to log in soon and see how it feels when I kick the tyres :-)

Update - success - used Firefox instead - looks like I've got some training manuals to update. I like the style, reminds me of google, but editing the attributes seems to require more vertical canvas - grr more scrolling!

Please give the development team any feedback you can, this is another great chance to have your say.

Scott

Wednesday, 6 June 2012

SQL Developer Preference Favourites

Inspired by Jeff Smith's post on SQL Developer preferences, I thought I'd share what I usually tweak when I sit down on a new box

Line Gutter

Personally, I think seeing the line number is vital. Yeah, I can see it in the status bar, but for the sake of a few pixels in width, it's so convenient to have it in the worksheet canvas.

Do note, however, that certain error messages may not line up with your line number as some line number reports will come from the database, for instance when you're compiling PL/SQL modules. You may already have other content above your little ad-hoc procedure, or if you're compiling a trigger no doubt you'll have some carriage returns in the first line - it's always hard to tell where triggers start counting line one!

Date format

When I train people how to use SQL, sometimes I get a little carried away with dates. I think they're fascinating, and they're also the cause of many logical errors when it comes to reporting, as many people forget or don't see there is a time component to their date column.

These settings directly affect your session level NLS settings.

Completion Insight

Some people love this sort of thing - I don't. I hate lag, and this can introduce it. Sometimes I'll dial the delay right down, perhaps when I'm working in an unfamiliar database, but most of the time I turn it off.

The checkbox options underneath also pertain to certain tastes, the change case as you type can be nifty but again, the other options can be annoying.


Syntax Colours

This is fairly unimportant, but I'm used to green, so I make my comments screen.

The options are there, go nuts.


Shortcut Keys

I'm a huge fan of keyboard shortcuts - I try to limit the usage of my mouse - it gets enough of a workout when surfing the web, and I'm sure it's use doesn't help my posture.

You can find some cool features just browsing through the list, or you can adjust common commands to suit your habits. Just watch you don't create a conflict between existing shortcuts.

I often change the commands to set UPPER/lower; ensure F8 doesn't launch SQL history - that really grinds my gears.

"Advanced" Settings

Nothing mind-bending here, but I reckon the default of 50 rows for the first set of rows isn't enough. I bump it up to about 150. Just because there might be a zillion rows in the table, the makers of SQL Developer thought it would be prudent to return the first bunch for you.

To find out how many rows in your complete result set you can hit Ctrl+A; press Ctrl+Down, or right-click in your result set and select Count Rows for a snappier answer.

If there was a really subtle yellow selection for the background colour of nulls, I'd use that (as per PL/SQL Developer, or is that a naughty word? Perhaps not as naughty as Toad). Perhaps a colour picker à la Syntax Colours would be nice.

Do not check auto-commit.


SQL Formatting

I don't do much PL/SQL development in SQL Developer (Sorry Jeff, Kris, TextPad wins) but for those that do, this is a flexible feature. I'll mention PL/SQL Developer again - I think that had a formatter that perfectly matched my style (I had a big say in the coding standards where I used that ;-), but you do have to pay for that product - SQL Developer is free!

I tend to write my code directly into the format required, because I am a little pedantic that way, and TextPad makes it easy for me.


Worksheet Options

Two points to note here, SQL History limit - some people might like to bump that up a little - doesn't cost much HD space... Don't forget, if all else fails, you can try v$sqlarea

The other is the "default path to look for scripts". I wasn't aware of that option until I read the comments on Jeff's post - but it seems my script catalog was available even when this field was empty.

Who am I but to question why? If it ain't broke...


Now all the team needs to do is get the footprint down and I'll be happy. It grows over time, I restart occasionally to make my laptop happy. It doesn't have quite the zing of a non-JRE application... rant over.

A final word - if you're still on SQL Developer 1.2 - upgrade, to at least 2.x. Latest versions = more stable + less bugs + more features.

Edit June 2018 
The above statement regarding version upgrades still applies, it's amazing how many out there using old SQL Dev versions.

Code Editor - "Use change of case as word boundary" - off, so underscores are not counted when skipping words with ctrl-arrow