Tuesday, April 17, 2012

Insert Japanese Language in to SQL

SQL Server supports multiple languages. Information about all the languages is stored in sys.syslanguages system view. You can run following script in Query Editor and see all the information about each language. Information about Months and Days varies for each language.
Syntax:
SELECT Alias, * FROM sys.syslanguages












The multiple languages are inserted only through the data types NCHAR, NVARCHAR and NTEXT, because the type of data is in different format. So the data should insert only in Unicode format.
Nchar (n) variables store fixed-length Unicode character strings consisting of exactly n characters (and, therefore, 2*n bytes). They are limited to 4,000 characters in size.
Nvarchar (n) variables store non-fixed length Unicode character strings consisting of approximately n characters. They consume 2*l+2 bytes of space, where l is the actual length of the string. They are limited to 4,000 characters in size.
Nvarchar (max) variables store non-fixed length Unicode character strings consisting of up to 536,870,912 characters. They consume l*2+2 bytes of space, where l is the actual length of the string.
Ntext variables store up to 2GB of text data (ANSI and Unicode, respectively), but cannot be used in many text operations. Therefore, they are usually only used to support legacy applications and have been replaced by the varchar (max) and nvarchar (max) data types.
Using Unicode characters in SQL Server:
Unicode is typically used in database applications which are designed to facilitate code pages which extend beyond the English and Western Europe code pages (Erland Sommarskog, a native of Sweden, refers to this set as "Germanic and Romance languages"), for example Japanese. Unicode is designed so that extended character sets can still "fit" into database columns. What this means is that Unicode character data types are limited to half the space, because each byte actually takes two bytes (Unicode is sometimes referred to as "double-wide"). There are many encoding schemes in the Unicode standard, but SQL Server only supports one: UTF-16.
“Unicode, the character-encoding scheme, is already a key standard for internationalization. Its relevance will increase as Web services and e-business becomes increasingly globalized.” “The world is a global village, trade crosses language barriers, and yet every one of us likes to feel comfortable within their own mother tongue. Unicode enabled us to give the local sense to every one of our users, while connecting the world of trade—which is the reason we will support Unicode in all of our products.”
An issue involved the storage of Japanese characters to the database. When we ran a query on the database using MS SQL Server (2008) Management Studio, the row that should have looked like this ‘日本の’ instead looked like question marks: ??????
Following are the solutions for avoid the above issue:-


  1. The question marks indicate that the data was really not stored correctly (data loss).
  2. If instead, your query results appear as square boxes (▯▯▯▯▯▯), your PC just does not have the language pack installed to view the characters. On Windows XP, go to Control Panel -> Regional and Language Options and check the Install files for East Asian languages checkbox.
  3. One possible cause of the data turning to question marks is if you insert a literal Unicode string but do not use the N prefix (e.g., N‘myunicodestring’). Setting it as just ‘myunicodestring’ can cause non-Latin characters to go to question marks.
  4. Another cause is if your column is not of a Unicode type. For instance, on SQL Server, you would want to use one of the n- character column types such as nvarchar(x).
Example
Here I’m using Japanese to create table name and column name and insert data in to the table. Please verify the table name, column name and data.












Insert Query

INSERT INTO 生産表(エントリ,項目,従業員キー,項目名,,カテゴリ項目,ステータス,請求書,項目部,お問い合わせ先 ,項目のステータス,カテゴリ,)VALUES(4,'CTB12',20988725,N'タービン圧縮',7,N'製造',N'いいえ',N'() 未決定の',N'空気力学',N'ジム',N'完了した',N'商用損害',N'宇宙航空事業部')









1. The table name is 生産表 [Production Table].But in SQL it shows in Unicode format, because windows XP is directly pointing to the Language English.When I change language in control pannel the table name and column name will shown in Japanese format. When I execute the query in text pane the query results will be in unicode format, and it is still in unicode format after importing the table into repository(OBIEE) .Once we use the column name in obiee reports we are able to see the data column in Japanese format.
2. The column name is 項目名 [Item name].Here I used the data type Nvarchar () because multi language can support only N prefix data types like NCHAR, NVARCHAR and NTEXT.
3. Insert Item name [タービン圧縮] in to the table. Here I need to initialize the N prefix before the Japanese character N’タービン圧縮’
4. Selection criteria. SELECT * FROM dbo.生産表.
5. The data also showing as Unicode format. Refer point 1
6. Column heading. Refer point 1

Externalize Presentation Layer


How to Externalize Presentation Layer i.e enable translation of Presentation Layer depending on the User Logged in Language.

Following steps are using for the translation of presentation layer:-
1. Open Administration Console and right click on the Presentation Subject Area that you would like to Externalize. You would see 2 options there to externalize names and descriptions. For now let’s externalize Names alone. So, click on Externalize Display Names.
2. Once this is done go to Tools->Utilities and Click on Execute to Externalize Strings.
3. Open up this Excel file and let’s understand the structure of the csv. The first column represents Actual Names prefixed by their types of the Presentation Layer. The second column represents a list of Session variables prefixed by CN_. Remember that by default CN_ would be prefixed. The 3rd column represents the actual translation. Let’s modify this csv and let’s add one more column called language. This language would have values of Languages supported by OBI EE (abbreviations).
4. The next step is to load this CSV file into a database table.
5. Now let’s import this table into the Physical layer.
6. The first step after importing this table is to create an initialization block to initialize the LOCALE variable based on the language selected by the user in Dashboard login. To do this creates a session initialization block having the data source from a database. The database sql would have a sql like this.
Select ‘VALUEOF (NQ_SESSION.WEBLANGUAGE)'
7. The next step is to create another session initialization block which would basically create a set of session variables using a database specific sql. The sql would look like this
Select SESSION_VARIABLE, TRANSLATION from external where LANGUAGE = ‘VALUEOF (NQ_SESSION.LOCALE)’
8. Then login to Dashboards using Japanese as the language.

Wednesday, August 31, 2011

Variables

OBIEE Variables

There are 3 types of variables in OBIEE

Presentation Variable

Repository Variable

Session Variable

Presentation Variable

Repository Variable

o Dynamic

o Static

Session Variable

o System

o Non System

Friday, August 26, 2011

OBIEE Architecture


OBIEE Architecture
OBIEE has a complex, SOA-based architecture consisting of a BI Server, BI Repository, BI Presentation Services, BI Scheduler and BI Java Host process.
The BI Presentation Services and BI Server are the two key components of the OBIEE Architecture. The BI Server connects to a wide variety of data sources, but integrates the data it retrieves using a mapping held in a local data store, the BI Repository, so that to its client applications it appears to contain a single table with a large number of columns. This semantic view of the enterprise’s data is presented to end users by the BI Presentation Services and is the basis for constructing ad hoc queries.
OBIEE Architecture consisting of
  •  BI Server
  • BI RepositoryBI Presentation Services
  • BI Scheduler
  • BI Java Host process
Oracle BI has two main components:
  • Oracle BI Presentation Services
  • Oracle Business Intelligence Applications
Oracle BI Presentation Services consists of:
  •  OBI Intelligence Answers
  • OBI Interactive Dashboards
  • OBI Delivers
Oracle Business Intelligence Applications
An Oracle BI application consists of pre-built, industry-specific Oracle BI interactive dashboards and Oracle BI reports that are built using industry best practices and address key functional areas within an organization. Oracle BI applications are integrated with operational applications to provide business metrics in reports, in context with an organization’s business function and industry.
Oracle BI applications include Extract Transform Load (ETL) routines to extract, transform, and load data into the Oracle Business Analytics Warehouse.

Different Views in OBIEE

Report Views:-

1.Table
2.Pivot Table
3.Title
4.Chart
5.Gauge
6.Filters
7.Compound Layout

Other Views:-

Column Selector,View Selector,Legend,Funnel Chart,Narrative,Ticker,Static Text,No Results,Logical SQL,Create Segment,Create Target List.