Book Image

Oracle APEX Cookbook : Second Edition

Book Image

Oracle APEX Cookbook : Second Edition

Overview of this book

Table of Contents (21 chapters)
Oracle APEX Cookbook Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Translating data in an application


Besides the application labels, there is more to translate in an application, for instance, data.

In this recipe, we will see an example of this. To accomplish this, we will use a built-in way of translating the session language that is new in APEX.

Getting ready

Start by creating some new database objects. Remember that this is a crude setup. In a production environment, this should be more elaborate.

First, we will create a copy of the EMP table, but with a change. The JOB column will now be called JOB_NO and it's content will reference to a EMP_JOB_TITLES table.

create table EMP_LANG
(
  empno    NUMBER(4) not null,
  ename    VARCHAR2(10),
  job_no   NUMBER,

  mgr      NUMBER(4),
  hiredate DATE,
  sal      NUMBER(7,2),
  comm     NUMBER(7,2),
  deptno   NUMBER(2)
);
[emp_lang.sql]

Also create the EMP_JOB_TITLES table. This table contains a LANGUAGE column that will hold the language in which the job_title is entered for that row.

This also means that job_no...