Territory code in UDB DB2 database

575 pts.
Tags:
DB2
Territory Codes
A reader wrote in with this question: <i>Can you explain the meaning of the territory code when creating a db2 udb database? Certain documentation say that the territory code determines the way dates are displayed but I've experimented by creating several databases with different territory codes but I don't see any difference when using these databases.</i>

Answer Wiki

Thanks. We'll let you know when a new response is added.

I don’t know specifically about the “territory code” (never worked on little DB2) but it sounds like the parameters “.

DB2 SQL can format dates & times in several different formats

try running the following to see what I mean:
SELECT CURRENT DATE AS “DEFAULT FORMAT”
,CHAR(CURRENT DATE,ISO) AS “ISO FORMAT”
,CHAR(CURRENT DATE,USA) AS “U.S.A. FORMAT”
,CHAR(CURRENT DATE,EUR) AS “EUROPEAN ”
FROM SYSIBM.SYSDUMMY1;

Then substitute TIME for DATE and run it again.

Here is sample SQL to do even more things with DATE (& TIME)

SELECT YEAR(date_col) YYYY, DAYOFYEAR(date_col) JJJ

SELECT
CASE MONTH(CURRENT DATE)
WHEN 1 THEN ‘JANUARY ‘
WHEN 2 THEN ‘FEBRUARY ‘
WHEN 3 THEN ‘MARCH ‘
WHEN 4 THEN ‘APRIL ‘
WHEN 5 THEN ‘MAY ‘
WHEN 6 THEN ‘JUNE ‘
WHEN 7 THEN ‘JULY ‘
WHEN 8 THEN ‘AUGUST ‘
WHEN 9 THEN ‘SEPTEMBER ‘
WHEN 10 THEN ‘OCTOBER ‘
WHEN 11 THEN ‘NOVEMBER ‘
WHEN 12 THEN ‘DECEMBER ‘
END

Good luck

meandyou

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following