COALESCE function and CASE WHEN

I tried to compare COALESCE and CASE WHEN.

SELECT  SUM(val)
FROM    (
  select CASE
       WHEN 1 IS NULL THEN  LENGTH(RAWTOHEX(SYS_GUID()))
       ELSE  1
       END AS val
  FROM dual
  CONNECT BY level = 10000
  );


There is no difference!

COALESCE function

I have been using NVL.  However, I think that we should all move to use COALESCE.

COALESCE is more modern function that is a part of ANSI-92 standard.
NVL is Oracle specific, it was introduced in 80's before there were any standards.

This testing describes the reason:

In case of two values, they are synonyms.
However, they are implemented differently.
NVL always evaluates both arguments, while COALESCE stops evaluation whenever it finds first non-NULL:

SELECT  SUM(val)
FROM    (
        SELECT  NVL(1, LENGTH(RAWTOHEX(SYS_GUID()))) AS val
        FROM    dual
        CONNECT BY
                level <= 10000
        )

This runs for almost 0.5 seconds, since it generates SYS_GUID()'s, despite 1 being not a NULL.
SELECT  SUM(val)
FROM    (
        SELECT  COALESCE(1, LENGTH(RAWTOHEX(SYS_GUID()))) AS val
        FROM    dual
        CONNECT BY
                level <= 10000
        )
This understands that 1 is not a NULL and does not evaluate the second argument.

SYS_GUID's are not generated and the query is instant.

 COALESCE is much efficient than NVL!

Fixed barrack, floating soldiers

I read a good article. It is written in Chinese 

铁打的营盘流水的兵  

This sentence's original meaning was "Soldiers come soldiers go, the military camps stay fortified." In military, soldiers typically stayed for a fixed period, such as two years.  However, there are regular missions and work have to done, and cannot be stopped.

If staff changing is expected, the way how to handle the situation is to keep some staff changes, not as often as others.

However, I also disagree that an organization should keep adding new people.  Adding people requires team building activities.  Changing the team member too often may make the team under an unstable state.

A good way to handle it is that assuming soldier only stay two years. Replacing half of them a year and keep the other half not changed.  You will still have people can lead.  You need to have some sergeants who can stay longer and lieutenants who may stay even longer.

Keeping everyone staying as long as possible may not be a good practice if there is not much growing opportunities inside, but a lot of great job opportunities outside.

Create a Quick Code for your contact information

I found that an easy way may be use PingTag.

I have been using Linkedin for several year. PingTag can create the QR Code from the Linedin information.

vCard and QR Code

vCard is an old standard.  It is a way to represent the contact information.  It is a digital version of a  business card.

When you receive a business card, you probably want to enter the data into your cell phone.

This is where the QR Code comes in.

QR Code is a way to get information into your phone.  Nowadays, phones almost all have the camera capability.  QR Code is a way to let you take a picture of the bar code and to scan the bar code into your phone.  One image can contain a lot of information.

Combining QR Code and vCard allows you to pass the information from the business card to your phone, without manually typing those information.

See also:
How to create a business card QR code
6 Good Reasons to Add a QR Code to Your Business Card

Gnumeric

I have been using Gnumeric for several months.  Although people still use Excel, I have set Gnumeric as the main tool to open Excel file lately.

Excel for some unknown reasons cannot work together with the web conference system I am using.  A ridiculous workaround is that while I am using the web conference system, I have to open Microsoft Net meeting.  I guess some secret code from Microsoft only compatible with Net Meeting.

This is so annoying.  I do not really need any new advanced features from Excel 2007.  For me, Excel 2007 is a defect product if I can use an older version of Excel with web conference system without any problem.

I found that Gnumeric is actually faster than Excel in turn of opening the file and show data.

Almost all functions are compatible.

A feature I am looking for from a presentation software

It should be easy to group a list of slide and give them a section overview.

Each slide should have six navigation buttons in Play mode:

  • Home
  • End
  • Next
  • Previous
  • Back to Section Overview
  • Next Section
The side navigation panel in the Design mode should show the outline structure.
Use the Section Header slide to "group" other sides and allow collapse and expand.

I found an old article "A Flexible Alternative to PowerPoint" on the net.  It said the same thing:

One of the disadvantages cited by Tufte and others is that PowerPoint tends to confine the speaker to a single pre-set path, discouraging spontaneity and diminishing flexibility in response to the audience's interests.

Browsers can not only emulate much of PowerPoint, they can also do things that PowerPoint does not....A table-of-contents window can be on screen at all times, allowing you to jump spontaneously to different topics.

Jython or Python?

I like Jython.

It supports unicode. Python does not support it well by default until Python3.

However, I still would prefer if we have Jython support for Python 3.

C:\>cd jython2.5.1
jython.bat

c = '斌'
c
'\xe6\x96\x8c'
print (c)


It is working!!

The End of the Beginning

Now this is not the end. It is not even the beginning of the end. But it is, perhaps, the end of the beginning.
~Winston Churchill

Oracle Application Express(4)

Sample Applications

The best way to create a new apps is actually copying and modifying the sample apps.

People Search
Bug Tracker
Document Library

http://www.oracle.com/technetwork/developer-tools/apex/application-express/packaged-apps-090453.html

Oracle Application Express(3)

SQL Workshop

SQL Workshop is an existing web application available in the workspace.

It may confuse those people who do not have SQL background and do not know anything about database.

However, since the APEX service providers assume that the workspace users are database application developers., so it provides such applications.

Most database developers use some kind of the database client software, such as SQL Developer. However, I do not think that you are allowed to use the SQL developer to access the hosted APEX database. The SQL Workshop is provided for serving the purposes:

1. Create Tables and other objects (view, index, sequence, synonym, trigger, etc.)
2. Create PL/SQL package, function, or procedure.
3. Query the database

It is the "SQL*Plus" for accessing APEX database.


However, it is also designed for those who do not know SQL and it provides wizard like step by step process to create tables and create queries. I think that most of the real database application developers may not need them. But it is a good learning tool for those who do not have SQL or database experiences.

You do not have to use those wizards. You can still do DDL and DML using SQL.

You can create scripts and upload your scripts. It is a little IDE for PL/SQL.

You can also upload data.

Oracle Application Express (2)

Application Workspace registration

You need to provide your name and your email during the registration.

Your email address will be used as the 1st user account that is assigned to this workspace.

Each workspace can have multiple users.

The user account created using the email address will be the workspace administrator.

You can create other users after you login.

However, the users created under the workspace are really the developers.

If people are just users of the applications, do not create them as users directly under the workspace.

Related Posts:

Oracle Application Express (1)

Oracle Application Express (1)

You can get an account here:

apex.oracle.com.

It is a hosted service that allows you to create web applications.

All these applications are database applications.

Behind the scene, an Oracle database is there.

After you register, an Oracle database schema is created for your workspace.

The application modules are declarative apps. The metadata is, of course, stored in the database.

ARIS Express for drawing diagrams

I just downloaded the ARIS Express. It seems a pretty good drawing tool.

The Wikipedia page has a very good introduction. It particularly highlighted the "Noteworthy features".

The ARIS Community web site provides the online video tutorials.

Oracle EBS Data Model

Oracle EBS provides the technical reference guide in eTRM. eTRM is a documentation service provided by Oracle to the customers that have the support contract - etrm.oracle.com.

Oracle EBS stores the tables and descriptions in FND_TABLES and FND_COLUMNS. If the table and columns are registered using AD_DD, the table and column descriptions will be stored in the above tables.

See Also:
http://oracledollars.forums-free.com/all_tab_cols-t30.html
http://www.allguru.net/oracle-apps-dba/fnd_tables-fnd_columns/

To get the correct list of columns for a table, the Oralce database data dictionary should be used. FND tables store the design time data. The FND table and column definition may be stored ahead of time before you apply a patch. The obsolete columns may still be represented in the tables.

Here is a script I found that merge the FND and Oracle database data dictionary.

http://www.sap-img.com/oracle-database/script-to-create-a-data-dictionary-listing-which-combines-the-oracle-dictionary-with-the-oracle-apps-dictionary.htm


Oracle EBS does not define the foreign keys within the database. In order to get the reference information, FND tables should be used. Oracle EBS does not use the USER_TAB_COMMENTS or USER_COL_COMMENTS.

Golf Team vs. Basketball team

I learned this from a management class I attended recently.

For a Golf team, you add the individual scores up to get the team's score. You put best players together to get the best score.

For a Basketball team, the team members need to work together to make score. You putting the best players together does not means that you have a best team.


As a manager, you have to make people work together. People can do a lot more than what individuals cannot do.



On the other hand, I have learned a old Chinese story: Three Monks, when I was a kid:

A young monk lives a simple life in a temple on top of a hill. He has one daily task of hauling two buckets of water up the hill. He tries to share the job with another monk, but the carry pole is only long enough for one bucket. The arrival of a third monk prompts everyone to expect that someone else will take on the chore. Consequently, no one fetches water though everybody is thirsty.


It is a big challenge for a manager to make people working together so 1 + 1 > 2, or at least 1 + 1 won't less than 2.



.

Customer Orientation vs Competitor Orientation

This is a very old topic. I first touch this topic while I was in college. I have always keeping this topic in my mind.

First, this is what I think about Competitor Orientation -

You only need to be better than others. As long as your customer do not have any other choice, you can be the king and do whatever you want.

And, Customer Orientation -

Customer is the king. You should try your best to satisfy your customer' need.


In software development, customer oriented design means thinking of what customer is looking for and competitor oriented design means looking at what competitor is offering.

In my experience, the competitor oriented design is a dangerous approach and really hurts the industry. However, unfortunately, both competition and customers lead us to take that approach.

A very simple example - or the most stupid thing I have seen - but still frequently happen is about adding columns to tables.

People seems never learned from mistakes.

Since the competitor's product has such column, we should add this column. Since the competitor's product has these many of columns, we should add more than what they have.

Does the customer really buy the product based on the number of columns?






Project Investiment Decision

The project investment decision should be based on the future forecasting.

What happened in the past is just sunk cost.


People frequently make mistake by using the "current" state to determine the future investment.

The "current" is only useful if it can be used to predict "future" in the investment decision.


A product like XX, which is the core product in Suite WW and is in almost all installations and the product XX is a very mature product.

Does that mean that we need to allocate more on it?

It is only meaningful if we assume that the more customers are using it, the more engineers need to be allocated to maintain it. Unfortunately it is typically not the case.


Should the size of the team match the revenue that the product is bringing? It sounds reasonable. The cost and revenue typically do not match in the same year. If you use operational leverage, the break even point can be multiple years. You won't do any big, potentially high return projects if you only look at the current revenues. You will never do new projects.


The revenue itself is not always a good measurement since the nature of the number is "short term". A better financial goal is to maximizing the shareholder value. We should look at the long term ROI. The discount cash flow can support the goal much better.


The discount cash flow concept sounds simple but seems frequently overlooked.

For each project or proposal, what we can do is that for each bucket, we can calculate the following:

how much revenue potential and thus the cash in flow it will bring in,
plus the cost saving the project can bring to us,
minus the initial cost to create it,
minus the cost to sustain it.

All of them need to present as the current value then we compare these initiatives.




One difficulty for making investment decision for software products is about the existing commitments, such as those over commitments done by sales. On the other hand, there are also implicit commitments. When a customer bought a product in the past, they are not just buying the product feature that available at that time. They also buy products from enterprise apps vendor to assume that the vendor will take care of their future needs. They believe that the product has a future.