Michael posted a comment on Martin’s blog, that I previously quoted, about a “hack” to add a comment on a default value definition. Here is an example of how it works (tested in 11.2.0.1):
SQL> CREATE TABLE t (
2 x VARCHAR2 (10) DEFAULT 'Hi' -- There. This will be stored too.
3 );
Table created.
Notice the comment after the default value. The comment would be ignored, right? think again:
SQL> COLUMN column_name FORMAT a14
SQL> COLUMN data_default FORMAT a40
SQL> SELECT column_name, data_default
2 FROM user_tab_columns
3 WHERE table_name = 'T';
COLUMN_NAME DATA_DEFAULT
-------------- ----------------------------------------
X 'Hi' -- There. This will be stored too.
1 row selected.
Well, basically this is bug 8546537:
When trying to add a COMMENT to a table, if the ‘)’ is on a new line, then the COMMENT is successfuly created when an error should be raised. The COMMENT also makes it to the Data Dictionary. If the ‘)’ is on the same line, an error is raised.
Interesting!
Leave a comment | Filed in Oracle | Tags: databaseMartin Widlake thinks so:
Comments are great, you can put 4000 characters of information into the database about each table, view and column. This can be a brief description of the object, a full explanation of what a column is to hold or even a list of typical entries for a column or table. But you can’t add a comment on indexes or constraints. Why would I want to? Well, constraints and indexes should only be there for a reason and the reason is not always obvious from either the names of the columns or the name of the constraint or index, especially where you have a naming standard that forces you to name indexes and constraints after the columns they reference.
He goes on to explain the advantages:
If I was able to add comments to constraints and indexes within the database then they would there. You move the system from one platform to the other, they are there. If for any wildly unlikely reason the central documentation lets you down, the information is always there in the database and easy to check. You may not be able to track down the original design documents but you have the database in front of you, so comments in that will persist and be very easy to find.
Martin raises very good points. I believe that it would be a useful feature to have in a future database version.
2 Comments | Filed in Oracle | Tags: enhancement
Happy New Year!
One of the events I am looking forward to this year is ODTUG Kscope12. For those of you who have attended Kscope before, you know how much value you can get out of this conference. For those of you who don’t know what Kscope is, here is a quick introduction for you:
If you are a developer, architect, technical lead, or database administrator who works with Application Express, Business Intelligence, Oracle EPM; including Hyperion products, Essbase, Planning; Database Development or Fusion Middleware, Kscope12 is where you should be. It’s hard to find a conference that’s big enough to attract world renowned speakers and small enough to get the chance to share knowledge. Kscope12 is that conference.
This year, I will be presenting about data caching at Kscope12.
1 Comment | Filed in Oracle | Tags: kscope12, odtugThere is a third issue, after support cost, and availability, there is the big issue around the upgrade path. Oracle have always said that there would be an upgrade path from the latest two releases which at the time was 11.5.10 and 12.0, but now we also have 12.1 so there is only a path from 12.0 onwards. Is this fair, well I am not sure, in most cases I see the move to Fusion Apps as a replacement is not the best thing for an organisation, especially one who has not already moved to R12, so not having the option is not a problem.Leave a comment | Filed in Oracle | Tags: EBS, fusion
[...]
I think a lot of people will take Fusion but in small steps, taking the co-existence route, after perhaps adopting some technology first, over time.
Suresh submitted this question on the Oracle Community forum:
in oracle 10 g , the below query results in alphabetical order , there is no order by caluse. but when i am running the same query in oracle 11g , it gives me in random order. what is the problem here?
People, it is really simple: You want an ordered result set? use ORDER BY.
Tom Kyte wrote about it in this blog post and in his books:
Do not ever count on the order of rows from a query unless you have an ORDER BY statement on your query!
The only way to retrieve data from the database in some sorted order is to include an ORDER BY on your query. There is no substitute for ORDER BY.
By the way, the query in the forum post looks suspiciously Hibernated. Don’t let Jeff know