DB2 Decimal Division Example

Decimal is one of the most commonly used data type in DB2 database. The difficulty with DECIMAL arises when division is the case. You can come through errors such negative scale or unexpected values. I prefer to use FLOAT casting and recasting to refrain from this kind of errors.

CREATE PROCEDURE DIVISION_EXAMPLE (IN BALANCE_EUR DECIMAL(20,2),
IN EXC_EUR_TO_USD DECIMAL(12,5),
OUT BALANCE_USD DECIMAL(20,2))
RESULT SETS 1
LANGUAGE SQL 

P1: BEGIN
DECLARE V_BALANCE_EUR FLOAT;
DECLARE V_EXC_EUR_TO_USD FLOAT;
DECLARE V_DIVISION FLOAT;

SET V_BALANCE_EUR = BALANCE_EUR;
SET V_EXC_EUR_TO_USD = EXC_EUR_TO_USD;
SET V_DIVISION = BALANCE_EUR / EXC_EUR_TO_USD;
SET BALANCE_USD = ROUND(V_DIVISION ,2);

END P1
Advertisements

A few words about Troux

Troux is the most established tool within enterprise architecture. All its roots are in enterprise architecture. Troux experiences is built into this software. 

I prefer to define Troux if its differentiative aspects with other enterprise architecture tools;

Fastest results with quantitative knowledge especially for strategic decision

A Digest Review of IBM System Architect

IBM System Architect is one of prominent enterprise architecture tool in the market.

IBM System Architect  is composed of 3 main components

  1. IBM System Architect (Rich Client)
  2. IBM System Architect XT
  3. IBM System Architect Publisher

IBM System Architect is the extensive software among other tools. Any stakeholder in the organization can find the features s/he needed. Business Motivation Model for strategy development, business process management features consisting process simulation, technical landscape components (routers, servers, client machines with their OS), are just some examples to show how diverse features System Architect has.

System Architect can do anything for your enterprise architecture. Now remember the saying ‘Jack of all trades, master of none’. I think it is best for the organizations that are interested in thoroughly follow what is actual landscape of the enterprise architecture especially with IT point of view. 

System Architect has its own unified meta-model for all aspects of defining elements from high level to low level. It’s very good practice to keep everything connected. The downside of this approach is the meta-model is well established and it might not be very easy to adopt to a new meta-model customized for a specific organization.

Up till now;

We can classify the enterprise architecture tools with respect to concerns;

  • Strategy
  1. Troux
  2. Alfabet
  3. Casewise
  4. Mega
  5. IBM System Architect
  • Business
  1. Casewise
  2. IBM System Architect
  3. Mega
  4. Troux
  5. Alfabet
  • Technology
  1. IBM System Architect
  2. Troux
  3. Mega
  4. Alfabet
  5. Casewise
  • Adaptabality
  1. Mega
  2. Casewise
  3. Alfabet
  4. Troux
  5. IBM System Architect