Tuesday, July 17, 2012

Being just a little bit unique

A few weeks back, I saw a mention of an old Tanel Poder post about the uniqueness of ROWIDs.

This is an interesting subject as a lot of people expect ROWIDs to be unique, but don't think about how unique that is. While you can't be a little bit pregnant, you can be a little bit unique. Or at least unique only within a specific subgroup.

The only complaint I have about the piece is that it is very DBAish. Lots of moving files around the OS and all those other things that DBAs like to do.

I'm a developer, and like to stick with SQL. And it is pretty easy to demonstrate the non-uniqueness of a ROWID without leaving SQL*PLUS.


SQL> CREATE CLUSTER emp_dept
  2     (dept_id NUMBER(4));


SQL> CREATE TABLE dept_c
  2     (dept_id number(4) primary key, dept_name varchar2(20))
  3     CLUSTER emp_dept (dept_id)
  4     ;


SQL> CREATE TABLE emp_c
  2     (emp_id number primary key,  name varchar(20), dept_id number(4))
  3     CLUSTER emp_dept (dept_id)
  4     ;


SQL> CREATE INDEX idx_emp_dept ON CLUSTER emp_dept;


SQL> insert into dept_c values (10,'Accounts');


SQL> insert into emp_c values (1,'Scott',10);


SQL> select rowid from dept_c
  2  union
  3  select rowid from emp_c;


ROWID
------------------
AAAF/4AAEAAACX9AAA



SQL> select rid, count(*), min(type), max(type)
  2  from
  3    (select 'D' type,  rowidtochar(rowid) rid from dept_c
  4    union all
  5    select 'C' type, rowidtochar(rowid) rid from emp_c)
  6  group by rid;


RID                  COUNT(*) M M
------------------ ---------- - -
AAAF/4AAEAAACX9AAA          2 C D



Of course a DBA will still argue that the ROWID is unique and this one simply doesn't belong to a table.

But the takeaway is that a ROWID is not tied to a single row in a single table in a database.

Saturday, July 07, 2012

Whatever happened to...Packaged Apex Applications

Many moons ago, there existed a bunch of packaged applications for Apex on the Oracle website.

Alas and alack, they were removed and all that exists in their place is a collection of sample code. They'll be making a comeback in Apex 4.2 where they will be 'prepacked' in the installation and ready to install. You can keep them vanilla, and perhaps get some support from Oracle for them (or maybe just an upgrade path), or you can unlock them and make your own customisations and enhancements.

These packaged productivity apps also got mentioned as part of the cloud.oracle.com offering. Assuming that does eventually materialize. Maybe its been waiting for Apex 4.2. (By the way, the EA is running on 11gR2 so there's no 12c hiding there.)

The only drawback is that the new packaged applications won't be available for anything earlier than 4.2. I guess it is possible for someone to unlock them and somehow achieve a backport to an earlier version, but I wouldn't count on it. Certainly don't expect that from Oracle.

Anyway, for a bit of nostalgia, I dug out one of those old packaged apps from my hard drive. The original Issue Tracker was developed for Apex 2.2 and is old enough to be attending school. The new one looks a lot more attractive. Since it caters for features such as uploading attachments, it looks much more like a usable application than a sample or demo.






Monday, July 02, 2012

Chrome, Firefox and chunky padlocks

For sometime now I have been using Chrome as my preferred browser. Once upon a time it was Firefox. But there's a few things about Firefox I dislike and this is one of them.


Some site, such as the New York Times, have a half-hearted implementation of HTTPS. I generally see this when someone who uses a tool like "HTTPS Everywhere" posts a link. The problem is that Firefox doesn't make it REALLY obvious that the https is a bit broken.


You see the regular icon, and if you bother to click on it, you get a little warning.




Now, compare that to Chrome, which gives you a big chunky warning you have to accept. 





And if you do accept it, you get a padlock with an 'x' on it, and a line drawn through the https text. This makes it obvious that it is broken.



When the https is okay, Firefox does give you the hostname but it isn't that great. Again, clicking gives you a bit more info.



Chrome gives you the padlock icon and a whole bunch of techie details are just a click away..