March 18, 2009

Unicode characterset in Oracle database.

Before starting this post let's have an idea about unicode. Unicode is a Universal encoding scheme which is designed to include far more characters than the normal character set, in fact, Unicode wants to be able to list ALL characters. So, with unicode support in oracle data from any languages can be stored and retrieved from oracle.

Oracle supports unicode within many of the character sets starting from Oracle 7.

Below is the list of character sets that is used to support unicode in oracle.

1)AL24UTFFSS: This character set was the first Unicode character set supported by Oracle. The AL24UTFFSS encoding scheme was based on the Unicode 1.1 standard, which is now obsolete. This unicode character set was used between oracle version 7.2 to 8.1.


2)UTF8: UTF8 was the UTF-8 encoded character set in Oracle8 and 8i. It followed the
Unicode 2.1 standard between Oracle 8.0 and 8.1.6, and was upgraded to Unicode
version 3.0 for oracle versions 8.1.7, 9i, 10g and 11g. If supplementary characters are inserted into in a UTF8 database encoded with Unicode version 3.0, then the actual data will be treated as 2 separate undefined characters, occupying 6 bytes in storage. So for fully support of supplementary characters use AL32UTF8 character set instead of UTF8.

3)UTFE: UTFE has the same properties as UTF8 on ASCII based platforms. As of UTF8 it is used in different oracle versions.


4)AL32UTF8: This is the UTF-8 encoded character set introduced in Oracle9i.
In Oracle 9.2 AL32UTF8 implemented unicode 3.1,
in 10.1 it implemented the Unicode 3.2 standard,
in Oracle 10.2 it supports the Unicode 4.01 standard and
in Oracle 11.1 it supports the Unicode 5.0.

AL32UTF8 was introduced to provide support for the newly defined supplementary characters. All supplementary characters are stored as 4 bytes in AL32UTF8. As while designed UTF-8 there was no concept of supplementary characters therefore UTF8 has a maximum of 3 bytes per character.

5)AL16UTF16: This is the first UTF-16 encoded character set in Oracle. It was introduced in Oracle9i as the default national character set (NLS_NCHAR_CHARACTERSET). It also provides support for the newly defined supplementary characters. All supplementary characters are stored as 4 bytes.
As with AL32UTF8, the plan is to keep enhancing AL16UTF16 as
necessary to support future version of the Unicode standard.

AL16UTF16 cannot be used as a database character set (NLS_CHARACTERSET), it is only used as the national character set (NLS_NCHAR_CHARACTERSET).

Like, AL32UTF8
In Oracle 9.0 AL16UTF16 implemented unicode 3.0,
in Oracle 9.2 it implemented unicode 3.1,
in 10.1 it implemented the Unicode 3.2 standard,
in Oracle 10.2 it supports the Unicode 4.01 standard and
in Oracle 11.1 it supports the Unicode 5.0.

How to know list of constraints and reference constraints in a table

Simply list of constranits along with the constraint_type you can achieve querying from dba_constraints/ user_constraints/ all_constraints.



SQL> select owner, constraint_name, constraint_type from dba_constraints
where owner='MAXIMSG' and table_name='SCM_INV_OPERATIONM';

OWNER CONSTRAINT_NAME C
------------------------------ ------------------------------ -
MAXIMSG SYS_C005768 C
MAXIMSG SYS_C005769 C
MAXIMSG SCM_INV_OPERATIONM_PK P
MAXIMSG OPM__OPERATION_BY_FK R
MAXIMSG OPM__STATUS_FK R
MAXIMSG INV_OPM__OP_ID_FK R
MAXIMSG INV_OPM__COMPANY_ENTITY_FK R
MAXIMSG INV_OPM__SCM_OPM_PERFORMER R
MAXIMSG OPM__ACCOUNT_FK R

9 rows selected.


In the column constraint_type there may have values C,P,U,R,V and O which means,
1)C :check constraint on a table
2)P :primary key
3)U :unique key
4)R :referential integrity
5)V :with check option, on a view
6)O :with read only, on a view

You can get constraints along with their columns and position by querying from DBA_CONS_COLUMNS/ USER_CONS_COLUMNS/ ALL_CONS_COLUMNS.


SQL> col owner for a10
col constraint_name for a27
col table_name for a25
col column_name for a23
set pages 100


SQL> select * from dba_cons_columns where table_name='SCM_INV_OPERATIONM'
and owner='MAXIMSG' order by constraint_name, position;

OWNER CONSTRAINT_NAME TABLE_NAME COLUMN_NAME POSITION
---------- --------------------------- ------------------------- ----------------------- ----------
MAXIMSG INV_OPM__COMPANY_ENTITY_FK SCM_INV_OPERATIONM COMPANY_ID 1
MAXIMSG INV_OPM__OP_ID_FK SCM_INV_OPERATIONM OPERATION_ID 1
MAXIMSG INV_OPM__SCM_OPM_PERFORMER SCM_INV_OPERATIONM OPERATION_PERFORMER_ID 1
MAXIMSG INV_OPM__SCM_OPM_PERFORMER SCM_INV_OPERATIONM COMPANY_ID 2
MAXIMSG OPM__ACCOUNT_FK SCM_INV_OPERATIONM CASH_ACC_ID 1
MAXIMSG OPM__ACCOUNT_FK SCM_INV_OPERATIONM COMPANY_ID 2
MAXIMSG OPM__OPERATION_BY_FK SCM_INV_OPERATIONM OPERATION_BY 1
MAXIMSG OPM__STATUS_FK SCM_INV_OPERATIONM OPERATION_STATUS 1
MAXIMSG SCM_INV_OPERATIONM_PK SCM_INV_OPERATIONM ID 1
MAXIMSG SYS_C005768 SCM_INV_OPERATIONM ID
MAXIMSG SYS_C005769 SCM_INV_OPERATIONM OPERATION_ID

11 rows selected.


By joining both two views you can get a list of constraints , their type, column_name, column position and their reference constraint name, reference table name in the constraint by,


SQL> col r_owner for a10
SQL> Select c.constraint_name, cc.column_name, c.r_owner,
c.r_constraint_name,c.constraint_type,cc.position, r.table_name
from dba_constraints c
JOIN dba_cons_columns cc
ON(c.table_name=cc.table_name AND c.owner=cc.owner
AND c.constraint_name=cc.constraint_name)
LEFT JOIN dba_constraints r
ON(c.r_constraint_name=r.constraint_name AND r.constraint_type in ('P','U') )
where c.table_name='SCM_INV_OPERATIONM' and c.owner='MAXIMSG' order by
constraint_name, position;

CONSTRAINT_NAME COLUMN_NAME R_OWNER R_CONSTRAINT_NAME C POS TABLE_NAME
--------------------------- ----------------------- ------- ------------------------ - --- ------------------------
INV_OPM__COMPANY_ENTITY_FK COMPANY_ID MAXIMSG PK_COMPANY R 1 HW_COMPANY_ENTITY
INV_OPM__OP_ID_FK OPERATION_ID MAXIMSG OPERATION__ID_PK R 1 SCM_OPERATION
INV_OPM__SCM_OPM_PERFORMER OPERATION_PERFORMER_ID MAXIMSG PK_SCM_OPERATION_PERFORM R 1 SCM_OPERATION_PERFORMER
INV_OPM__SCM_OPM_PERFORMER COMPANY_ID MAXIMSG PK_SCM_OPERATION_PERFORM R 2 SCM_OPERATION_PERFORMER
OPM__ACCOUNT_FK CASH_ACC_ID MAXIMSG PK_ACCOUNT R 1 HW_ACCOUNT
OPM__ACCOUNT_FK COMPANY_ID MAXIMSG PK_ACCOUNT R 2 HW_ACCOUNT
OPM__OPERATION_BY_FK OPERATION_BY MAXIMSG PK_SCM_ME R 1 SCM_ME
OPM__STATUS_FK OPERATION_STATUS MAXIMSG PK_HW_STATUS R 1 HW_STATUS
SCM_INV_OPERATIONM_PK ID P 1
SYS_C005768 ID C
SYS_C005769 OPERATION_ID C

11 rows selected.

How to run csscan in the background as a sysdba

With a simple command,
csscan system/test full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4
you can run csscan in order to check all character data in the database and tests for the effects and problems of changing the character set encoding.

As csscan runs in the foreground (by default), so if you exits the terminal from which you run csscan, csscan also stops there. This is quite a pain task whenever you run csscan to another remote computer via ssh or any terminal software as you can't ensure network connectivity. So if network goes your terminal terminates and csscan terminates as well.

In order to solve the problem unix nohup tool is a great rid of our pain. With help of nohup we can run the process in the background and send the output to a text file; thus exiting the terminal remains the process running in the backend. After hours/days we can check the process whether it completed or not.

To run csscan in the background issue following command,
$nohup csscan system/a full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4 &

Note that at the end you have to append an ampersand to send the process in the background.

Later we can check the status of our csscan by,
$ps -ef |grep csscan
to be sure whether scanning is completed or not.

As we know in order to character set scanning process we need to scan full database. And sys is the most powerful user. So to access everything always run csscan as "sys as sysdba." Oracle also recommends to run csscan as a sys user. Thus running csscan as a sys user you might face difficulties. Like ,

[oracle@dbsoft ~]$ csscan sys/a as sysdba full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4
LRM-00108: invalid positional parameter value 'as'
failed to process command line parameters

Scanner terminated unsuccessfully.

[oracle@dbsoft ~]$ csscan userid="sys/a as sysdba" full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4
[1] 8042
LRM-00112: multiple values not allowed for parameter 'userid'

[oracle@dbsoft ~]$ csscan sys/a full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4


Character Set Scanner v2.1 : Release 10.2.0.0.0 - Production on Sat Mar 7 18:03:59 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.


ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

Scanner terminated unsuccessfully.
Though you can avoid the lastest erro by following http://arjudba.blogspot.com/2008/05/ora-28009-connection-as-sys-should-be.html that is by setting O7_DICTIONARY_ACCESSIBILITY=TRUE but this is not recommended.

So the issue stands how to run csscan as "sys as sysdba" and the process need to run the background. To do this below is the steps.

Step 01: Run csscan with nohup but only without any userid parameter(username+password).
$ nohup csscan
For example:
$nohup csscan full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4

Note that at the end there is no ampersand.

Step 02: Press Enter button from keyboard.

Step 03: At this steps all terminal output is being redirected to nohup.out and so, you can't see it, but your terminal is waiting for a username and password input.
So give the password of sys and connect as sysdba.
Like enter following words,
sys/a as sysdba
where the password of user sys is a.

Step 04: Press Enter button from keyboard.

Step 05: At this stage, csscan should be running, in the foreground, and all terminal
output is redirecting to nohup.out.

You still see your shell prompt is there but it takes no keyword. Just
press ctrl+z

Step 06: In the shell prompt type,
bg

You have done it. Now your csscan will run in the background and you may quit your current window or disconnect network or log off the terminal. Process will keep running and you will get the output of terminal in the file nohup.out. Check the status of the process by,

$ps -ef |grep csscan

Note: Make sure that you type the "bg" at the shell after the ctrl+z. If you don't do that process will remain suspended and will not do anything.

From my terminal here is the sample screenshot.

[oracle@dbsoft ~]$ nohup csscan full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4
nohup: appending output to `nohup.out'
sys/a as sysdba
bg


After this I press the cross button to close window.
In a new session I login and I got my progress inside nohup.out.
[oracle@dbsoft ~]$ cat nohup.out
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

Enumerating tables to scan...

. process 2 scanning MAXIMSG.SUBSCRIBERS_CARDS[AAAM6NAAGAAAXwJAAA]
. process 1 scanning MAXIMSG.FIRST_LEG_ACC[AAAM4IAAGAAAD+JAAA]


Remember the alternative. Also you can do above tasks by simply using escape characters with your options like below.

$nohup $ORACLE_HOME/bin/csscan userid=\'sys/a as sysdba\' full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4 &

Enjoy the post. Keep reading my blog.

CSSCAN fails with error while loading shared libraries: libclntsh.so.10.1

Problem Description
While running csscan in order to check all character data in the database and tests for the effects and problems of changing the character set, it fails with error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file as below.

[oracle@dbsoft ~]$ csscan sys/a as sysdba full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4
csscan: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory

Cause and solution of the Problem The problem happens due to missing entry of LD_LIBRARY_PATH environmental variable. Proper setting of the parameter will solve the problem. On my 32 bit Red hat linux system setting,
$export LD_LIBRARY_PATH=$ORACLE_HOME/lib
will solve the problem.
Details about this problem is discussed on,

CSSCAN fails with CSS-00151: failed to enumerate user tables CSS-00120

Problem Description
While running csscan it fails with ORA-00942, CSS-00151 and CSS-00120 as below.

$ csscan user=prod2 tochar=AL32UTF8 ARRAY=1024000 process=4

Character Set Scanner v2.1 : Release 10.2.0.3.0 - Production on Sat Mar 7 20:27:08 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Username:system

Password:

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


Enumerating tables to scan...

ORA-00942: table or view does not exist
CSS-00151: failed to enumerate user tables
CSS-00120: failed to enumerate tables to scan

Scanner terminated unsuccessfully

Solution of the Problem
I found no where the solution of the problem. But I noticed that re-running the $ORACLE_HOME/rdbms/admin/csminst.sql script would solve the problem. Re-running the csminst.sql will drop the csmig user and re-create the csmig user. So, in order to solute the problem,
1)connect to database sys as sysdba.
$sqlplus / as sysdba

2)Run the csminstl.sql
SQL>@$ORACLE_HOME/rdbms/admin/csminst.sql

3)Re-run the csscan.
$ csscan user=prod2 tochar=AL32UTF8 ARRAY=1024000 process=4

CSSCAN fails with ORA-00600, CSS-00152, CSS-00120

Problem Description
While running csscan it fails with error message ORA-600, CSS-00152: failed to enumerate all tables and CSS-00120 as below.

$ csscan system/a FULL=Y FROMCHAR=WE8ISO8859P1 TOCHAR=WE8MSWIN1252 LOG=csscanwin1252
ARRAY=1000000 PROCESS=2


Character Set Scanner v2.1 : Release 10.2.0.0.0 - Production on Sat Mar 7 21:10:05 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

Enumerating tables to scan...
Warning: Entry/Exit code is optimized. Cannot restore context (UNWIND 22)

ORA-00600: internal error code, arguments: [15160], [], [], [], [], [], [], []
CSS-00152: failed to enumerate all tables
CSS-00120: failed to enumerate tables to scan

Scanner terminated unsuccessfully.

Cause of the Problem
Scan fails because of the existence of tables in the recyclebin.

Solution of the Problem
1)Purge Recyclebin Objects: Query from dba_recyclebin and be sure you need those objects ever. If not purge them. To do this as sys as sysdba issue,

SQL>conn sys as sysdba

SQL>purge dba_recyclebin;

2)Run csscan again.
$ csscan system/a FULL=Y FROMCHAR=WE8ISO8859P1 TOCHAR=WE8MSWIN1252 LOG=csscanwin1252
ARRAY=1000000 PROCESS=2

Difference between WE8ISO8859P1 and WE8MSWIN1252 characterset

The lists of characters along with their code points used in oracle database character set WE8ISO8859P1 is defined in the http://msdn.microsoft.com/en-us/goglobal/cc305167.aspx.

And the lists of characters along with their code points used in oracle database character set WE8MSWIN1252 is defined in the http://msdn.microsoft.com/en-us/goglobal/cc305145.aspx

* If we look for the characters and code points for both character sets then we will find that every characters defined under WE8ISO8859P1 exists in character set WE8MSWIN1252 plus WE8MSWIN1252 contains some additions characters. So we can say WE8MSWIN1252 is logical super set of WE8ISO8859P1.


* If we look further details, we see total 27 code points are not existing in P1 that are filled in / used in WE8MSWIN1252.


* Also, no code points have a different symbol in WE8MSWIN1252 than in WE8ISO8859P1 soWE8MSWIN1252 is a binary super set of WE8ISO8859P1.


We see in WE8MSWIN1252 the euro symbol (€) is defined as code point 80(hex number). But in WE8ISO8859P1 the euro symbol is unassigned/ not defined. Below is the list of characters that is defined in WE8MSWIN1252 but undefined in WE8ISO8859P1.

In the list,
Column #1 is the WE8MSWIN1252 characters table code in hexadecimal.
Column #2 is the Unicode code in hexadecimal.
Column #3 is the list of characters displayed by numerical call and by their value.
Column #4 is the Description of the character.


WIN- Unicod Charact Description
1251 e Char ers
---- ------ ------- ----------------------------
0x80 0x20AC [€] [€] EURO SIGN
0x82 0x201A [‚] [‚] SINGLE LOW-9 QUOTATION MARK
0x83 0x0192 [ƒ] [ƒ] LATIN SMALL LETTER F WITH HOOK
0x84 0x201E [„] [„] DOUBLE LOW-9 QUOTATION MARK
0x85 0x2026 […] […] HORIZONTAL ELLIPSIS
0x86 0x2020 [†] [†] DAGGER
0x87 0x2021 [‡] [‡] DOUBLE DAGGER
0x88 0x02C6 [ˆ] [ˆ] MODIFIER LETTER CIRCUMFLEX ACCENT
0x89 0x2030 [‰] [‰] PER MILLE SIGN
0x8A 0x0160 [Š] [Š] LATIN CAPITAL LETTER S WITH CARON
0x8B 0x2039 [‹] [‹] SINGLE LEFT-POINTING ANGLE QUOTATION MARK
0x8C 0x0152 [Œ] [Œ] LATIN CAPITAL LIGATURE OE
0x8E 0x017D [Ž] [Ž] LATIN CAPITAL LETTER Z WITH CARON
0x91 0x2018 [‘] [‘] LEFT SINGLE QUOTATION MARK
0x92 0x2019 [’] [’] RIGHT SINGLE QUOTATION MARK
0x93 0x201C [“] [“] LEFT DOUBLE QUOTATION MARK
0x94 0x201D [”] [”] RIGHT DOUBLE QUOTATION MARK
0x95 0x2022 [•] [•] BULLET
0x96 0x2013 [–] [–] EN DASH
0x97 0x2014 [—] [—] EM DASH
0x98 0x02DC [˜] [˜] SMALL TILDE
0x99 0x2122 [™] [™] TRADE MARK SIGN
0x9A 0x0161 [š] [š] LATIN SMALL LETTER S WITH CARON
0x9B 0x203A [›] [›] SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
0x9C 0x0153 [œ] [œ] LATIN SMALL LIGATURE OE
0x9E 0x017E [ž] [ž] LATIN SMALL LETTER Z WITH CARON
0x9F 0x0178 [Ÿ] [Ÿ] LATIN CAPITAL LETTER Y WITH DIAERESIS


Below is the list of characters under WE8ISO8859P1 and WE8MSWIN1252 along with their code points.


Dec. Unico. Charac. WE8ISO8859P1 Character Description
---- ------ ------- (States if different) -----------
0x00 0x0000 [ ] [ ] NULL
0x01 0x0001 [ ] [ ] START OF HEADING
0x02 0x0002 [ ] [ ] START OF TEXT
0x03 0x0003 [ ] [ ] END OF TEXT
0x04 0x0004 [ ] [ ] END OF TRANSMISSION
0x05 0x0005 [ ] [ ] ENQUIRY
0x06 0x0006 [ ] [ ] ACKNOWLEDGE
0x07 0x0007 [ ] [ ] BELL
0x08 0x0008 [ ] [ ] BACKSPACE
0x09 0x0009 [ ] [ ] HORIZONTAL TABULATION
0x0A 0x000A [ ] [ ] LINE FEED
0x0B 0x000B [ ] [ ] VERTICAL TABULATION
0x0C 0x000C [ ] [ ] FORM FEED
0x0D 0x000D [ ] [ ] CARRIAGE RETURN
0x0E 0x000E [ ] [ ] SHIFT OUT
0x0F 0x000F [ ] [ ] SHIFT IN
0x10 0x0010 [ ] [ ] DATA LINK ESCAPE
0x11 0x0011 [ ] [ ] DEVICE CONTROL ONE
0x12 0x0012 [ ] [ ] DEVICE CONTROL TWO
0x13 0x0013 [ ] [ ] DEVICE CONTROL THREE
0x14 0x0014 [ ] [ ] DEVICE CONTROL FOUR
0x15 0x0015 [ ] [ ] NEGATIVE ACKNOWLEDGE
0x16 0x0016 [ ] [ ] SYNCHRONOUS IDLE
0x17 0x0017 [ ] [ ] END OF TRANSMISSION BLOCK
0x18 0x0018 [ ] [ ] CANCEL
0x19 0x0019 [ ] [ ] END OF MEDIUM
0x1A 0x001A [ ] [ ] SUBSTITUTE
0x1B 0x001B [ ] [ ] ESCAPE
0x1C 0x001C [ ] [ ] FILE SEPARATOR
0x1D 0x001D [ ] [ ] GROUP SEPARATOR
0x1E 0x001E [ ] [ ] RECORD SEPARATOR
0x1F 0x001F [ ] [ ] UNIT SEPARATOR
0x20 0x0020 [ ] [ ] SPACE
0x21 0x0021 [!] [!] EXCLAMATION MARK
0x22 0x0022 ["] ["] QUOTATION MARK
0x23 0x0023 [#] [#] NUMBER SIGN
0x24 0x0024 [$] [$] DOLLAR SIGN
0x25 0x0025 [%] [%] PERCENT SIGN
0x26 0x0026 [&] [&] AMPERSAND
0x27 0x0027 ['] ['] APOSTROPHE
0x28 0x0028 [(] [(] LEFT PARENTHESIS
0x29 0x0029 [)] [)] RIGHT PARENTHESIS
0x2A 0x002A [*] [*] ASTERISK
0x2B 0x002B [+] [+] PLUS SIGN
0x2C 0x002C [,] [,] COMMA
0x2D 0x002D [-] [-] HYPHEN-MINUS
0x2E 0x002E [.] [.] FULL STOP
0x2F 0x002F [/] [/] SOLIDUS
0x30 0x0030 [0] [0] DIGIT ZERO
0x31 0x0031 [1] [1] DIGIT ONE
0x32 0x0032 [2] [2] DIGIT TWO
0x33 0x0033 [3] [3] DIGIT THREE
0x34 0x0034 [4] [4] DIGIT FOUR
0x35 0x0035 [5] [5] DIGIT FIVE
0x36 0x0036 [6] [6] DIGIT SIX
0x37 0x0037 [7] [7] DIGIT SEVEN
0x38 0x0038 [8] [8] DIGIT EIGHT
0x39 0x0039 [9] [9] DIGIT NINE
0x3A 0x003A [:] [:] COLON
0x3B 0x003B [;] [;] SEMICOLON
0x3C 0x003C [<] [<] LESS-THAN SIGN
0x3D 0x003D [=] [=] EQUALS SIGN
0x3E 0x003E [>] [>] GREATER-THAN SIGN
0x3F 0x003F [?] [?] QUESTION MARK
0x40 0x0040 [@] [@] COMMERCIAL AT
0x41 0x0041 [A] [A] LATIN CAPITAL LETTER A
0x42 0x0042 [B] [B] LATIN CAPITAL LETTER B
0x43 0x0043 [C] [C] LATIN CAPITAL LETTER C
0x44 0x0044 [D] [D] LATIN CAPITAL LETTER D
0x45 0x0045 [E] [E] LATIN CAPITAL LETTER E
0x46 0x0046 [F] [F] LATIN CAPITAL LETTER F
0x47 0x0047 [G] [G] LATIN CAPITAL LETTER G
0x48 0x0048 [H] [H] LATIN CAPITAL LETTER H
0x49 0x0049 [I] [I] LATIN CAPITAL LETTER I
0x4A 0x004A [J] [J] LATIN CAPITAL LETTER J
0x4B 0x004B [K] [K] LATIN CAPITAL LETTER K
0x4C 0x004C [L] [L] LATIN CAPITAL LETTER L
0x4D 0x004D [M] [M] LATIN CAPITAL LETTER M
0x4E 0x004E [N] [N] LATIN CAPITAL LETTER N
0x4F 0x004F [O] [O] LATIN CAPITAL LETTER O
0x50 0x0050 [P] [P] LATIN CAPITAL LETTER P
0x51 0x0051 [Q] [Q] LATIN CAPITAL LETTER Q
0x52 0x0052 [R] [R] LATIN CAPITAL LETTER R
0x53 0x0053 [S] [S] LATIN CAPITAL LETTER S
0x54 0x0054 [T] [T] LATIN CAPITAL LETTER T
0x55 0x0055 [U] [U] LATIN CAPITAL LETTER U
0x56 0x0056 [V] [V] LATIN CAPITAL LETTER V
0x57 0x0057 [W] [W] LATIN CAPITAL LETTER W
0x58 0x0058 [X] [X] LATIN CAPITAL LETTER X
0x59 0x0059 [Y] [Y] LATIN CAPITAL LETTER Y
0x5A 0x005A [Z] [Z] LATIN CAPITAL LETTER Z
0x5B 0x005B [[] [[] LEFT SQUARE BRACKET
0x5C 0x005C [\] [\] REVERSE SOLIDUS
0x5D 0x005D []] []] RIGHT SQUARE BRACKET
0x5E 0x005E [^] [^] CIRCUMFLEX ACCENT
0x5F 0x005F [_] [_] LOW LINE
0x60 0x0060 [`] [`] GRAVE ACCENT
0x61 0x0061 [a] [a] LATIN SMALL LETTER A
0x62 0x0062 [b] [b] LATIN SMALL LETTER B
0x63 0x0063 [c] [c] LATIN SMALL LETTER C
0x64 0x0064 [d] [d] LATIN SMALL LETTER D
0x65 0x0065 [e] [e] LATIN SMALL LETTER E
0x66 0x0066 [f] [f] LATIN SMALL LETTER F
0x67 0x0067 [g] [g] LATIN SMALL LETTER G
0x68 0x0068 [h] [h] LATIN SMALL LETTER H
0x69 0x0069 [i] [i] LATIN SMALL LETTER I
0x6A 0x006A [j] [j] LATIN SMALL LETTER J
0x6B 0x006B [k] [k] LATIN SMALL LETTER K
0x6C 0x006C [l] [l] LATIN SMALL LETTER L
0x6D 0x006D [m] [m] LATIN SMALL LETTER M
0x6E 0x006E [n] [n] LATIN SMALL LETTER N
0x6F 0x006F [o] [o] LATIN SMALL LETTER O
0x70 0x0070 [p] [p] LATIN SMALL LETTER P
0x71 0x0071 [q] [q] LATIN SMALL LETTER Q
0x72 0x0072 [r] [r] LATIN SMALL LETTER R
0x73 0x0073 [s] [s] LATIN SMALL LETTER S
0x74 0x0074 [t] [t] LATIN SMALL LETTER T
0x75 0x0075 [u] [u] LATIN SMALL LETTER U
0x76 0x0076 [v] [v] LATIN SMALL LETTER V
0x77 0x0077 [w] [w] LATIN SMALL LETTER W
0x78 0x0078 [x] [x] LATIN SMALL LETTER X
0x79 0x0079 [y] [y] LATIN SMALL LETTER Y
0x7A 0x007A [z] [z] LATIN SMALL LETTER Z
0x7B 0x007B [{] [{] LEFT CURLY BRACKET
0x7C 0x007C [|] [|] VERTICAL LINE
0x7D 0x007D [}] [}] RIGHT CURLY BRACKET
0x7E 0x007E [~] [~] TILDE
0x7F 0x007F [ ] [ ] DELETE
0x80 0x20AC [€] [€] UNDEFINED EURO SIGN
0x81 [ ] [ ] UNDEFINED UNDEFINED
0x82 0x201A [‚] [‚] UNDEFINED SINGLE LOW-9 QUOTATION MARK
0x83 0x0192 [ƒ] [ƒ] UNDEFINED LATIN SMALL LETTER F WITH HOOK
0x84 0x201E [„] [„] UNDEFINED DOUBLE LOW-9 QUOTATION MARK
0x85 0x2026 […] […] UNDEFINED HORIZONTAL ELLIPSIS
0x86 0x2020 [†] [†] UNDEFINED DAGGER
0x87 0x2021 [‡] [‡] UNDEFINED DOUBLE DAGGER
0x88 0x02C6 [ˆ] [ˆ] UNDEFINED MODIFIER LETTER CIRCUMFLEX ACCENT
0x89 0x2030 [‰] [‰] UNDEFINED PER MILLE SIGN
0x8A 0x0160 [Š] [Š] UNDEFINED LATIN CAPITAL LETTER S WITH CARON
0x8B 0x2039 [‹] [‹] UNDEFINED SINGLE LEFT-POINTING ANGLE QUOTATION MARK
0x8C 0x0152 [Œ] [Œ] UNDEFINED LATIN CAPITAL LIGATURE OE
0x8D [ ] [ ] UNDEFINED UNDEFINED
0x8E 0x017D [Ž] [Ž] UNDEFINED LATIN CAPITAL LETTER Z WITH CARON
0x8F [ ] [ ] UNDEFINED UNDEFINED
0x90 [ ] [ ] UNDEFINED UNDEFINED
0x91 0x2018 [‘] [‘] UNDEFINED LEFT SINGLE QUOTATION MARK
0x92 0x2019 [’] [’] UNDEFINED RIGHT SINGLE QUOTATION MARK
0x93 0x201C [“] [“] UNDEFINED LEFT DOUBLE QUOTATION MARK
0x94 0x201D [”] [”] UNDEFINED RIGHT DOUBLE QUOTATION MARK
0x95 0x2022 [•] [•] UNDEFINED BULLET
0x96 0x2013 [–] [–] UNDEFINED EN DASH
0x97 0x2014 [—] [—] UNDEFINED EM DASH
0x98 0x02DC [˜] [˜] UNDEFINED SMALL TILDE
0x99 0x2122 [™] [™] UNDEFINED TRADE MARK SIGN
0x9A 0x0161 [š] [š] UNDEFINED LATIN SMALL LETTER S WITH CARON
0x9B 0x203A [›] [›] UNDEFINED SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
0x9C 0x0153 [œ] [œ] UNDEFINED LATIN SMALL LIGATURE OE
0x9D [ ] [ ] UNDEFINED UNDEFINED
0x9E 0x017E [ž] [ž] UNDEFINED LATIN SMALL LETTER Z WITH CARON
0x9F 0x0178 [Ÿ] [Ÿ] UNDEFINED LATIN CAPITAL LETTER Y WITH DIAERESIS
0xA0 0x00A0 [ ] [ ] NO-BREAK SPACE
0xA1 0x00A1 [¡] [¡] INVERTED EXCLAMATION MARK
0xA2 0x00A2 [¢] [¢] CENT SIGN
0xA3 0x00A3 [£] [£] POUND SIGN
0xA4 0x00A4 [¤] [¤] CURRENCY SIGN
0xA5 0x00A5 [¥] [¥] YEN SIGN
0xA6 0x00A6 [¦] [¦] BROKEN BAR
0xA7 0x00A7 [§] [§] SECTION SIGN
0xA8 0x00A8 [¨] [¨] DIAERESIS
0xA9 0x00A9 [©] [©] COPYRIGHT SIGN
0xAA 0x00AA [ª] [ª] FEMININE ORDINAL INDICATOR
0xAB 0x00AB [«] [«] LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
0xAC 0x00AC [¬] [¬] NOT SIGN
0xAD 0x00AD [ ] [ ] SOFT HYPHEN
0xAE 0x00AE [®] [®] REGISTERED SIGN
0xAF 0x00AF [¯] [¯] MACRON
0xB0 0x00B0 [°] [°] DEGREE SIGN
0xB1 0x00B1 [±] [±] PLUS-MINUS SIGN
0xB2 0x00B2 [²] [²] SUPERSCRIPT TWO
0xB3 0x00B3 [³] [³] SUPERSCRIPT THREE
0xB4 0x00B4 [´] [´] ACUTE ACCENT
0xB5 0x00B5 [µ] [µ] MICRO SIGN
0xB6 0x00B6 [¶] [¶] PILCROW SIGN
0xB7 0x00B7 [·] [·] MIDDLE DOT
0xB8 0x00B8 [¸] [¸] CEDILLA
0xB9 0x00B9 [¹] [¹] SUPERSCRIPT ONE
0xBA 0x00BA [º] [º] MASCULINE ORDINAL INDICATOR
0xBB 0x00BB [»] [»] RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
0xBC 0x00BC [¼] [¼] VULGAR FRACTION ONE QUARTER
0xBD 0x00BD [½] [½] VULGAR FRACTION ONE HALF
0xBE 0x00BE [¾] [¾] VULGAR FRACTION THREE QUARTERS
0xBF 0x00BF [¿] [¿] INVERTED QUESTION MARK
0xC0 0x00C0 [À] [À] LATIN CAPITAL LETTER A WITH GRAVE
0xC1 0x00C1 [Á] [Á] LATIN CAPITAL LETTER A WITH ACUTE
0xC2 0x00C2 [Â] [Â] LATIN CAPITAL LETTER A WITH CIRCUMFLEX
0xC3 0x00C3 [Ã] [Ã] LATIN CAPITAL LETTER A WITH TILDE
0xC4 0x00C4 [Ä] [Ä] LATIN CAPITAL LETTER A WITH DIAERESIS
0xC5 0x00C5 [Å] [Å] LATIN CAPITAL LETTER A WITH RING ABOVE
0xC6 0x00C6 [Æ] [Æ] LATIN CAPITAL LETTER AE
0xC7 0x00C7 [Ç] [Ç] LATIN CAPITAL LETTER C WITH CEDILLA
0xC8 0x00C8 [È] [È] LATIN CAPITAL LETTER E WITH GRAVE
0xC9 0x00C9 [É] [É] LATIN CAPITAL LETTER E WITH ACUTE
0xCA 0x00CA [Ê] [Ê] LATIN CAPITAL LETTER E WITH CIRCUMFLEX
0xCB 0x00CB [Ë] [Ë] LATIN CAPITAL LETTER E WITH DIAERESIS
0xCC 0x00CC [Ì] [Ì] LATIN CAPITAL LETTER I WITH GRAVE
0xCD 0x00CD [Í] [Í] LATIN CAPITAL LETTER I WITH ACUTE
0xCE 0x00CE [Î] [Î] LATIN CAPITAL LETTER I WITH CIRCUMFLEX
0xCF 0x00CF [Ï] [Ï] LATIN CAPITAL LETTER I WITH DIAERESIS
0xD0 0x00D0 [Ð] [Ð] LATIN CAPITAL LETTER ETH
0xD1 0x00D1 [Ñ] [Ñ] LATIN CAPITAL LETTER N WITH TILDE
0xD2 0x00D2 [Ò] [Ò] LATIN CAPITAL LETTER O WITH GRAVE
0xD3 0x00D3 [Ó] [Ó] LATIN CAPITAL LETTER O WITH ACUTE
0xD4 0x00D4 [Ô] [Ô] LATIN CAPITAL LETTER O WITH CIRCUMFLEX
0xD5 0x00D5 [Õ] [Õ] LATIN CAPITAL LETTER O WITH TILDE
0xD6 0x00D6 [Ö] [Ö] LATIN CAPITAL LETTER O WITH DIAERESIS
0xD7 0x00D7 [×] [×] MULTIPLICATION SIGN
0xD8 0x00D8 [Ø] [Ø] LATIN CAPITAL LETTER O WITH STROKE
0xD9 0x00D9 [Ù] [Ù] LATIN CAPITAL LETTER U WITH GRAVE
0xDA 0x00DA [Ú] [Ú] LATIN CAPITAL LETTER U WITH ACUTE
0xDB 0x00DB [Û] [Û] LATIN CAPITAL LETTER U WITH CIRCUMFLEX
0xDC 0x00DC [Ü] [Ü] LATIN CAPITAL LETTER U WITH DIAERESIS
0xDD 0x00DD [Ý] [Ý] LATIN CAPITAL LETTER Y WITH ACUTE
0xDE 0x00DE [Þ] [Þ] LATIN CAPITAL LETTER THORN
0xDF 0x00DF [ß] [ß] LATIN SMALL LETTER SHARP S
0xE0 0x00E0 [à] [à] LATIN SMALL LETTER A WITH GRAVE
0xE1 0x00E1 [á] [á] LATIN SMALL LETTER A WITH ACUTE
0xE2 0x00E2 [â] [â] LATIN SMALL LETTER A WITH CIRCUMFLEX
0xE3 0x00E3 [ã] [ã] LATIN SMALL LETTER A WITH TILDE
0xE4 0x00E4 [ä] [ä] LATIN SMALL LETTER A WITH DIAERESIS
0xE5 0x00E5 [å] [å] LATIN SMALL LETTER A WITH RING ABOVE
0xE6 0x00E6 [æ] [æ] LATIN SMALL LETTER AE
0xE7 0x00E7 [ç] [ç] LATIN SMALL LETTER C WITH CEDILLA
0xE8 0x00E8 [è] [è] LATIN SMALL LETTER E WITH GRAVE
0xE9 0x00E9 [é] [é] LATIN SMALL LETTER E WITH ACUTE
0xEA 0x00EA [ê] [ê] LATIN SMALL LETTER E WITH CIRCUMFLEX
0xEB 0x00EB [ë] [ë] LATIN SMALL LETTER E WITH DIAERESIS
0xEC 0x00EC [ì] [ì] LATIN SMALL LETTER I WITH GRAVE
0xED 0x00ED [í] [í] LATIN SMALL LETTER I WITH ACUTE
0xEE 0x00EE [î] [î] LATIN SMALL LETTER I WITH CIRCUMFLEX
0xEF 0x00EF [ï] [ï] LATIN SMALL LETTER I WITH DIAERESIS
0xF0 0x00F0 [ð] [ð] LATIN SMALL LETTER ETH
0xF1 0x00F1 [ñ] [ñ] LATIN SMALL LETTER N WITH TILDE
0xF2 0x00F2 [ò] [ò] LATIN SMALL LETTER O WITH GRAVE
0xF3 0x00F3 [ó] [ó] LATIN SMALL LETTER O WITH ACUTE
0xF4 0x00F4 [ô] [ô] LATIN SMALL LETTER O WITH CIRCUMFLEX
0xF5 0x00F5 [õ] [õ] LATIN SMALL LETTER O WITH TILDE
0xF6 0x00F6 [ö] [ö] LATIN SMALL LETTER O WITH DIAERESIS
0xF7 0x00F7 [÷] [÷] DIVISION SIGN
0xF8 0x00F8 [ø] [ø] LATIN SMALL LETTER O WITH STROKE
0xF9 0x00F9 [ù] [ù] LATIN SMALL LETTER U WITH GRAVE
0xFA 0x00FA [ú] [ú] LATIN SMALL LETTER U WITH ACUTE
0xFB 0x00FB [û] [û] LATIN SMALL LETTER U WITH CIRCUMFLEX
0xFC 0x00FC [ü] [ü] LATIN SMALL LETTER U WITH DIAERESIS
0xFD 0x00FD [ý] [ý] LATIN SMALL LETTER Y WITH ACUTE
0xFE 0x00FE [þ] [þ] LATIN SMALL LETTER THORN
0xFF 0x00FF [ÿ] [ÿ] LATIN SMALL LETTER Y WITH DIAERESIS

Difference between WE8ISO8859P1 and WE8ISO8859P15 characterset

The lists of characters along with their code points used in oracle database character set WE8ISO8859P1 is defined in the http://msdn.microsoft.com/en-us/goglobal/cc305167.aspx.

And the lists of characters along with their code points used in oracle database character set WE8ISO8859P15 is defined in the http://msdn.microsoft.com/en-us/goglobal/cc305176.aspx.

The oracle database character set WE8ISO8859P15 differs from WE8ISO8859P1 in a few positions only.

In the oracle database character set WE8ISO8859P15 the euro sign and some national letters used in French and Finnish have been introduced and some rarely used special characters omitted that was exist in WE8ISO8859P1.

Below is the lists of WE8ISO8859P1 and WE8ISO8859P15 character sets that differ by code position only.


Code | WE8ISO8859P1 (ISO Latin 1) | WE8ISO8859P15 (ISO Latin 9)
in | |
hex | name | name
------+------------------------------+------------------------------------
A4 | general currency symbol(¤) | euro sign (€)
| |
A6 | broken vertical bar (¦) | latin capital letter s with caron (Š)
| |
A8 | umlaut (diaeresis) accent(¨)| latin small letter s with caron (š)
| |
B4 | acute accent (´) | latin capital letter z with caron (Ž)
| |
B8 | cedilla (¸) | latin small letter z with caron (ž)
| |
BC | one fourth (one quarter) (¼)| latin capital ligature oe (Œ)
| |
BD | one half (½) | latin small ligature oe (œ)
| |
BE | three quarters (¾) | latin capital letter y with diaeresis (Ÿ)



Except the above characters and the characters that are undefined, rest of the characters in WE8ISO8859P15 has the same code point in WE8ISO8859P1.

Note that in both WE8ISO8859P15 and WE8ISO8859P1 the code points from 0x80 to 0x9F are undefined. So whenever you want to find different between these two the undefined characters also appear in the list.


SQL>set serveroutput on
declare
i number;
begin
for i in 0..255 loop
declare
ch varchar2(1);
begin
ch := chr(i);
if convert( ch, 'WE8ISO8859P1', 'WE8ISO8859P15') != ch
then
dbms_output.put_line('Difference- Decimal:'|| i ||' Hexa:'|| to_char(i,'XXXX'));
end if;
end;
end loop;
end;
/
Difference- Decimal:128 Hexa: 80
Difference- Decimal:129 Hexa: 81
Difference- Decimal:130 Hexa: 82
Difference- Decimal:131 Hexa: 83
Difference- Decimal:132 Hexa: 84
Difference- Decimal:133 Hexa: 85
Difference- Decimal:134 Hexa: 86
Difference- Decimal:135 Hexa: 87
Difference- Decimal:136 Hexa: 88
Difference- Decimal:137 Hexa: 89
Difference- Decimal:138 Hexa: 8A
Difference- Decimal:139 Hexa: 8B
Difference- Decimal:140 Hexa: 8C
Difference- Decimal:141 Hexa: 8D
Difference- Decimal:142 Hexa: 8E
Difference- Decimal:143 Hexa: 8F
Difference- Decimal:144 Hexa: 90
Difference- Decimal:145 Hexa: 91
Difference- Decimal:146 Hexa: 92
Difference- Decimal:147 Hexa: 93
Difference- Decimal:148 Hexa: 94
Difference- Decimal:149 Hexa: 95
Difference- Decimal:150 Hexa: 96
Difference- Decimal:151 Hexa: 97
Difference- Decimal:152 Hexa: 98
Difference- Decimal:153 Hexa: 99
Difference- Decimal:154 Hexa: 9A
Difference- Decimal:155 Hexa: 9B
Difference- Decimal:156 Hexa: 9C
Difference- Decimal:157 Hexa: 9D
Difference- Decimal:158 Hexa: 9E
Difference- Decimal:159 Hexa: 9F
Difference- Decimal:164 Hexa: A4
Difference- Decimal:166 Hexa: A6
Difference- Decimal:168 Hexa: A8
Difference- Decimal:180 Hexa: B4
Difference- Decimal:184 Hexa: B8
Difference- Decimal:188 Hexa: BC
Difference- Decimal:189 Hexa: BD
Difference- Decimal:190 Hexa: BE

PL/SQL procedure successfully completed.


In both character set from 0x80 to 0x9F all the code points are undefined. And the rest 8 characters are different between the two.

Also the WE8ISO8859P1 and WE8ISO8859P15 character sets are not binary super sets of each other.

Difference between WE8MSWIN1252 and WE8ISO8859P15 characterset

The lists of characters along with their code points used in oracle database character set WE8ISO8859P15 is defined in the http://msdn.microsoft.com/en-us/goglobal/cc305176.aspx.

Also, the lists of characters along with their code points used in oracle database character set WE8MSWIN1252 is defined in the http://msdn.microsoft.com/en-us/goglobal/cc305145.aspx.

If we look for WE8MSWIN1252 and WE8ISO8859P15 character set then 28 code points are not existed in WE8ISO8859P15 but they are used/filled in WE8MSWIN1252.

Also all of the characters exist in WE8ISO8859P15 are also exists in WE8MSWIN1252. So we can say WE8MSWIN1252 is a logical superset of character set WE8ISO8859P15 but not a binary superset.

Also we see 8 codepoints have a different symbol in WE8MSWIN1252 than in P15 for the same physical codepoint.

Below is the lists of all characters under both character sets along with their code points.


Dec. Unico. Charac. WE8ISO8859P15 Character Description
---- ------ ------- (States if different) -----------
0x00 0x0000 [ ] [ ] NULL
0x01 0x0001 [ ] [ ] START OF HEADING
0x02 0x0002 [ ] [ ] START OF TEXT
0x03 0x0003 [ ] [ ] END OF TEXT
0x04 0x0004 [ ] [ ] END OF TRANSMISSION
0x05 0x0005 [ ] [ ] ENQUIRY
0x06 0x0006 [ ] [ ] ACKNOWLEDGE
0x07 0x0007 [ ] [ ] BELL
0x08 0x0008 [ ] [ ] BACKSPACE
0x09 0x0009 [ ] [ ] HORIZONTAL TABULATION
0x0A 0x000A [ ] [ ] LINE FEED
0x0B 0x000B [ ] [ ] VERTICAL TABULATION
0x0C 0x000C [ ] [ ] FORM FEED
0x0D 0x000D [ ] [ ] CARRIAGE RETURN
0x0E 0x000E [ ] [ ] SHIFT OUT
0x0F 0x000F [ ] [ ] SHIFT IN
0x10 0x0010 [ ] [ ] DATA LINK ESCAPE
0x11 0x0011 [ ] [ ] DEVICE CONTROL ONE
0x12 0x0012 [ ] [ ] DEVICE CONTROL TWO
0x13 0x0013 [ ] [ ] DEVICE CONTROL THREE
0x14 0x0014 [ ] [ ] DEVICE CONTROL FOUR
0x15 0x0015 [ ] [ ] NEGATIVE ACKNOWLEDGE
0x16 0x0016 [ ] [ ] SYNCHRONOUS IDLE
0x17 0x0017 [ ] [ ] END OF TRANSMISSION BLOCK
0x18 0x0018 [ ] [ ] CANCEL
0x19 0x0019 [ ] [ ] END OF MEDIUM
0x1A 0x001A [ ] [ ] SUBSTITUTE
0x1B 0x001B [ ] [ ] ESCAPE
0x1C 0x001C [ ] [ ] FILE SEPARATOR
0x1D 0x001D [ ] [ ] GROUP SEPARATOR
0x1E 0x001E [ ] [ ] RECORD SEPARATOR
0x1F 0x001F [ ] [ ] UNIT SEPARATOR
0x20 0x0020 [ ] [ ] SPACE
0x21 0x0021 [!] [!] EXCLAMATION MARK
0x22 0x0022 ["] ["] QUOTATION MARK
0x23 0x0023 [#] [#] NUMBER SIGN
0x24 0x0024 [$] [$] DOLLAR SIGN
0x25 0x0025 [%] [%] PERCENT SIGN
0x26 0x0026 [&] [&] AMPERSAND
0x27 0x0027 ['] ['] APOSTROPHE
0x28 0x0028 [(] [(] LEFT PARENTHESIS
0x29 0x0029 [)] [)] RIGHT PARENTHESIS
0x2A 0x002A [*] [*] ASTERISK
0x2B 0x002B [+] [+] PLUS SIGN
0x2C 0x002C [,] [,] COMMA
0x2D 0x002D [-] [-] HYPHEN-MINUS
0x2E 0x002E [.] [.] FULL STOP
0x2F 0x002F [/] [/] SOLIDUS
0x30 0x0030 [0] [0] DIGIT ZERO
0x31 0x0031 [1] [1] DIGIT ONE
0x32 0x0032 [2] [2] DIGIT TWO
0x33 0x0033 [3] [3] DIGIT THREE
0x34 0x0034 [4] [4] DIGIT FOUR
0x35 0x0035 [5] [5] DIGIT FIVE
0x36 0x0036 [6] [6] DIGIT SIX
0x37 0x0037 [7] [7] DIGIT SEVEN
0x38 0x0038 [8] [8] DIGIT EIGHT
0x39 0x0039 [9] [9] DIGIT NINE
0x3A 0x003A [:] [:] COLON
0x3B 0x003B [;] [;] SEMICOLON
0x3C 0x003C [<] [<] LESS-THAN SIGN
0x3D 0x003D [=] [=] EQUALS SIGN
0x3E 0x003E [>] [>] GREATER-THAN SIGN
0x3F 0x003F [?] [?] QUESTION MARK
0x40 0x0040 [@] [@] COMMERCIAL AT
0x41 0x0041 [A] [A] LATIN CAPITAL LETTER A
0x42 0x0042 [B] [B] LATIN CAPITAL LETTER B
0x43 0x0043 [C] [C] LATIN CAPITAL LETTER C
0x44 0x0044 [D] [D] LATIN CAPITAL LETTER D
0x45 0x0045 [E] [E] LATIN CAPITAL LETTER E
0x46 0x0046 [F] [F] LATIN CAPITAL LETTER F
0x47 0x0047 [G] [G] LATIN CAPITAL LETTER G
0x48 0x0048 [H] [H] LATIN CAPITAL LETTER H
0x49 0x0049 [I] [I] LATIN CAPITAL LETTER I
0x4A 0x004A [J] [J] LATIN CAPITAL LETTER J
0x4B 0x004B [K] [K] LATIN CAPITAL LETTER K
0x4C 0x004C [L] [L] LATIN CAPITAL LETTER L
0x4D 0x004D [M] [M] LATIN CAPITAL LETTER M
0x4E 0x004E [N] [N] LATIN CAPITAL LETTER N
0x4F 0x004F [O] [O] LATIN CAPITAL LETTER O
0x50 0x0050 [P] [P] LATIN CAPITAL LETTER P
0x51 0x0051 [Q] [Q] LATIN CAPITAL LETTER Q
0x52 0x0052 [R] [R] LATIN CAPITAL LETTER R
0x53 0x0053 [S] [S] LATIN CAPITAL LETTER S
0x54 0x0054 [T] [T] LATIN CAPITAL LETTER T
0x55 0x0055 [U] [U] LATIN CAPITAL LETTER U
0x56 0x0056 [V] [V] LATIN CAPITAL LETTER V
0x57 0x0057 [W] [W] LATIN CAPITAL LETTER W
0x58 0x0058 [X] [X] LATIN CAPITAL LETTER X
0x59 0x0059 [Y] [Y] LATIN CAPITAL LETTER Y
0x5A 0x005A [Z] [Z] LATIN CAPITAL LETTER Z
0x5B 0x005B [[] [[] LEFT SQUARE BRACKET
0x5C 0x005C [\] [\] REVERSE SOLIDUS
0x5D 0x005D []] []] RIGHT SQUARE BRACKET
0x5E 0x005E [^] [^] CIRCUMFLEX ACCENT
0x5F 0x005F [_] [_] LOW LINE
0x60 0x0060 [`] [`] GRAVE ACCENT
0x61 0x0061 [a] [a] LATIN SMALL LETTER A
0x62 0x0062 [b] [b] LATIN SMALL LETTER B
0x63 0x0063 [c] [c] LATIN SMALL LETTER C
0x64 0x0064 [d] [d] LATIN SMALL LETTER D
0x65 0x0065 [e] [e] LATIN SMALL LETTER E
0x66 0x0066 [f] [f] LATIN SMALL LETTER F
0x67 0x0067 [g] [g] LATIN SMALL LETTER G
0x68 0x0068 [h] [h] LATIN SMALL LETTER H
0x69 0x0069 [i] [i] LATIN SMALL LETTER I
0x6A 0x006A [j] [j] LATIN SMALL LETTER J
0x6B 0x006B [k] [k] LATIN SMALL LETTER K
0x6C 0x006C [l] [l] LATIN SMALL LETTER L
0x6D 0x006D [m] [m] LATIN SMALL LETTER M
0x6E 0x006E [n] [n] LATIN SMALL LETTER N
0x6F 0x006F [o] [o] LATIN SMALL LETTER O
0x70 0x0070 [p] [p] LATIN SMALL LETTER P
0x71 0x0071 [q] [q] LATIN SMALL LETTER Q
0x72 0x0072 [r] [r] LATIN SMALL LETTER R
0x73 0x0073 [s] [s] LATIN SMALL LETTER S
0x74 0x0074 [t] [t] LATIN SMALL LETTER T
0x75 0x0075 [u] [u] LATIN SMALL LETTER U
0x76 0x0076 [v] [v] LATIN SMALL LETTER V
0x77 0x0077 [w] [w] LATIN SMALL LETTER W
0x78 0x0078 [x] [x] LATIN SMALL LETTER X
0x79 0x0079 [y] [y] LATIN SMALL LETTER Y
0x7A 0x007A [z] [z] LATIN SMALL LETTER Z
0x7B 0x007B [{] [{] LEFT CURLY BRACKET
0x7C 0x007C [|] [|] VERTICAL LINE
0x7D 0x007D [}] [}] RIGHT CURLY BRACKET
0x7E 0x007E [~] [~] TILDE
0x7F 0x007F [ ] [ ] DELETE
0x80 0x20AC [€] [€] UNDEFINED EURO SIGN
0x81 [ ] [ ] UNDEFINED UNDEFINED
0x82 0x201A [‚] [‚] UNDEFINED SINGLE LOW-9 QUOTATION MARK
0x83 0x0192 [ƒ] [ƒ] UNDEFINED LATIN SMALL LETTER F WITH HOOK
0x84 0x201E [„] [„] UNDEFINED DOUBLE LOW-9 QUOTATION MARK
0x85 0x2026 […] […] UNDEFINED HORIZONTAL ELLIPSIS
0x86 0x2020 [†] [†] UNDEFINED DAGGER
0x87 0x2021 [‡] [‡] UNDEFINED DOUBLE DAGGER
0x88 0x02C6 [ˆ] [ˆ] UNDEFINED MODIFIER LETTER CIRCUMFLEX ACCENT
0x89 0x2030 [‰] [‰] UNDEFINED PER MILLE SIGN
0x8A 0x0160 [Š] [Š] UNDEFINED LATIN CAPITAL LETTER S WITH CARON
0x8B 0x2039 [‹] [‹] UNDEFINED SINGLE LEFT-POINTING ANGLE QUOTATION MARK
0x8C 0x0152 [Œ] [Œ] UNDEFINED LATIN CAPITAL LIGATURE OE
0x8D [ ] [ ] UNDEFINED UNDEFINED
0x8E 0x017D [Ž] [Ž] UNDEFINED LATIN CAPITAL LETTER Z WITH CARON
0x8F [ ] [ ] UNDEFINED UNDEFINED
0x90 [ ] [ ] UNDEFINED UNDEFINED
0x91 0x2018 [‘] [‘] UNDEFINED LEFT SINGLE QUOTATION MARK
0x92 0x2019 [’] [’] UNDEFINED RIGHT SINGLE QUOTATION MARK
0x93 0x201C [“] [“] UNDEFINED LEFT DOUBLE QUOTATION MARK
0x94 0x201D [”] [”] UNDEFINED RIGHT DOUBLE QUOTATION MARK
0x95 0x2022 [•] [•] UNDEFINED BULLET
0x96 0x2013 [–] [–] UNDEFINED EN DASH
0x97 0x2014 [—] [—] UNDEFINED EM DASH
0x98 0x02DC [˜] [˜] UNDEFINED SMALL TILDE
0x99 0x2122 [™] [™] UNDEFINED TRADE MARK SIGN
0x9A 0x0161 [š] [š] UNDEFINED LATIN SMALL LETTER S WITH CARON
0x9B 0x203A [›] [›] UNDEFINED SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
0x9C 0x0153 [œ] [œ] UNDEFINED LATIN SMALL LIGATURE OE
0x9D [ ] [ ] UNDEFINED UNDEFINED
0x9E 0x017E [ž] [ž] UNDEFINED LATIN SMALL LETTER Z WITH CARON
0x9F 0x0178 [Ÿ] [Ÿ] UNDEFINED LATIN CAPITAL LETTER Y WITH DIAERESIS
0xA0 0x00A0 [ ] [ ] NO-BREAK SPACE
0xA1 0x00A1 [¡] [¡] INVERTED EXCLAMATION MARK
0xA2 0x00A2 [¢] [¢] CENT SIGN
0xA3 0x00A3 [£] [£] POUND SIGN
0xA4 0x00A4 [¤] [¤] Euro Sign(€) MS1252 code point 80 CURRENCY SIGN
0xA5 0x00A5 [¥] [¥] YEN SIGN
0xA6 0x00A6 [¦] [¦] LATIN CAPITAL LETTER S WITH CARON(Š) 8A BROKEN BAR
0xA7 0x00A7 [§] [§] SECTION SIGN
0xA8 0x00A8 [¨] [¨] LATIN SMALL LETTER S WITH CARON(š) 9A DIAERESIS
0xA9 0x00A9 [©] [©] COPYRIGHT SIGN
0xAA 0x00AA [ª] [ª] FEMININE ORDINAL INDICATOR
0xAB 0x00AB [«] [«] LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
0xAC 0x00AC [¬] [¬] NOT SIGN
0xAD 0x00AD [ ] [ ] SOFT HYPHEN
0xAE 0x00AE [®] [®] REGISTERED SIGN
0xAF 0x00AF [¯] [¯] MACRON
0xB0 0x00B0 [°] [°] DEGREE SIGN
0xB1 0x00B1 [±] [±] PLUS-MINUS SIGN
0xB2 0x00B2 [²] [²] SUPERSCRIPT TWO
0xB3 0x00B3 [³] [³] SUPERSCRIPT THREE
0xB4 0x00B4 [´] [´] LATIN CAPITAL LETTER Z WITH CARON(Ž) 8E ACUTE ACCENT
0xB5 0x00B5 [µ] [µ] MICRO SIGN
0xB6 0x00B6 [¶] [¶] PILCROW SIGN
0xB7 0x00B7 [·] [·] MIDDLE DOT
0xB8 0x00B8 [¸] [¸] LATIN SMALL LETTER Z WITH CARON(ž) 9E CEDILLA
0xB9 0x00B9 [¹] [¹] SUPERSCRIPT ONE
0xBA 0x00BA [º] [º] MASCULINE ORDINAL INDICATOR
0xBB 0x00BB [»] [»] RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
0xBC 0x00BC [¼] [¼] LATIN CAPITAL LIGATURE OE(Œ) 8C VULGAR FRACTION ONE QUARTER
0xBD 0x00BD [½] [½] LATIN SMALL LIGATURE OE(œ) 9C VULGAR FRACTION ONE HALF
0xBE 0x00BE [¾] [¾] LATIN CAPITAL LETTER Y WITH DIAERESIS(Ÿ) 9F VULGAR FRACTION THREE QUARTERS
0xBF 0x00BF [¿] [¿] INVERTED QUESTION MARK
0xC0 0x00C0 [À] [À] LATIN CAPITAL LETTER A WITH GRAVE
0xC1 0x00C1 [Á] [Á] LATIN CAPITAL LETTER A WITH ACUTE
0xC2 0x00C2 [Â] [Â] LATIN CAPITAL LETTER A WITH CIRCUMFLEX
0xC3 0x00C3 [Ã] [Ã] LATIN CAPITAL LETTER A WITH TILDE
0xC4 0x00C4 [Ä] [Ä] LATIN CAPITAL LETTER A WITH DIAERESIS
0xC5 0x00C5 [Å] [Å] LATIN CAPITAL LETTER A WITH RING ABOVE
0xC6 0x00C6 [Æ] [Æ] LATIN CAPITAL LETTER AE
0xC7 0x00C7 [Ç] [Ç] LATIN CAPITAL LETTER C WITH CEDILLA
0xC8 0x00C8 [È] [È] LATIN CAPITAL LETTER E WITH GRAVE
0xC9 0x00C9 [É] [É] LATIN CAPITAL LETTER E WITH ACUTE
0xCA 0x00CA [Ê] [Ê] LATIN CAPITAL LETTER E WITH CIRCUMFLEX
0xCB 0x00CB [Ë] [Ë] LATIN CAPITAL LETTER E WITH DIAERESIS
0xCC 0x00CC [Ì] [Ì] LATIN CAPITAL LETTER I WITH GRAVE
0xCD 0x00CD [Í] [Í] LATIN CAPITAL LETTER I WITH ACUTE
0xCE 0x00CE [Î] [Î] LATIN CAPITAL LETTER I WITH CIRCUMFLEX
0xCF 0x00CF [Ï] [Ï] LATIN CAPITAL LETTER I WITH DIAERESIS
0xD0 0x00D0 [Ð] [Ð] LATIN CAPITAL LETTER ETH
0xD1 0x00D1 [Ñ] [Ñ] LATIN CAPITAL LETTER N WITH TILDE
0xD2 0x00D2 [Ò] [Ò] LATIN CAPITAL LETTER O WITH GRAVE
0xD3 0x00D3 [Ó] [Ó] LATIN CAPITAL LETTER O WITH ACUTE
0xD4 0x00D4 [Ô] [Ô] LATIN CAPITAL LETTER O WITH CIRCUMFLEX
0xD5 0x00D5 [Õ] [Õ] LATIN CAPITAL LETTER O WITH TILDE
0xD6 0x00D6 [Ö] [Ö] LATIN CAPITAL LETTER O WITH DIAERESIS
0xD7 0x00D7 [×] [×] MULTIPLICATION SIGN
0xD8 0x00D8 [Ø] [Ø] LATIN CAPITAL LETTER O WITH STROKE
0xD9 0x00D9 [Ù] [Ù] LATIN CAPITAL LETTER U WITH GRAVE
0xDA 0x00DA [Ú] [Ú] LATIN CAPITAL LETTER U WITH ACUTE
0xDB 0x00DB [Û] [Û] LATIN CAPITAL LETTER U WITH CIRCUMFLEX
0xDC 0x00DC [Ü] [Ü] LATIN CAPITAL LETTER U WITH DIAERESIS
0xDD 0x00DD [Ý] [Ý] LATIN CAPITAL LETTER Y WITH ACUTE
0xDE 0x00DE [Þ] [Þ] LATIN CAPITAL LETTER THORN
0xDF 0x00DF [ß] [ß] LATIN SMALL LETTER SHARP S
0xE0 0x00E0 [à] [à] LATIN SMALL LETTER A WITH GRAVE
0xE1 0x00E1 [á] [á] LATIN SMALL LETTER A WITH ACUTE
0xE2 0x00E2 [â] [â] LATIN SMALL LETTER A WITH CIRCUMFLEX
0xE3 0x00E3 [ã] [ã] LATIN SMALL LETTER A WITH TILDE
0xE4 0x00E4 [ä] [ä] LATIN SMALL LETTER A WITH DIAERESIS
0xE5 0x00E5 [å] [å] LATIN SMALL LETTER A WITH RING ABOVE
0xE6 0x00E6 [æ] [æ] LATIN SMALL LETTER AE
0xE7 0x00E7 [ç] [ç] LATIN SMALL LETTER C WITH CEDILLA
0xE8 0x00E8 [è] [è] LATIN SMALL LETTER E WITH GRAVE
0xE9 0x00E9 [é] [é] LATIN SMALL LETTER E WITH ACUTE
0xEA 0x00EA [ê] [ê] LATIN SMALL LETTER E WITH CIRCUMFLEX
0xEB 0x00EB [ë] [ë] LATIN SMALL LETTER E WITH DIAERESIS
0xEC 0x00EC [ì] [ì] LATIN SMALL LETTER I WITH GRAVE
0xED 0x00ED [í] [í] LATIN SMALL LETTER I WITH ACUTE
0xEE 0x00EE [î] [î] LATIN SMALL LETTER I WITH CIRCUMFLEX
0xEF 0x00EF [ï] [ï] LATIN SMALL LETTER I WITH DIAERESIS
0xF0 0x00F0 [ð] [ð] LATIN SMALL LETTER ETH
0xF1 0x00F1 [ñ] [ñ] LATIN SMALL LETTER N WITH TILDE
0xF2 0x00F2 [ò] [ò] LATIN SMALL LETTER O WITH GRAVE
0xF3 0x00F3 [ó] [ó] LATIN SMALL LETTER O WITH ACUTE
0xF4 0x00F4 [ô] [ô] LATIN SMALL LETTER O WITH CIRCUMFLEX
0xF5 0x00F5 [õ] [õ] LATIN SMALL LETTER O WITH TILDE
0xF6 0x00F6 [ö] [ö] LATIN SMALL LETTER O WITH DIAERESIS
0xF7 0x00F7 [÷] [÷] DIVISION SIGN
0xF8 0x00F8 [ø] [ø] LATIN SMALL LETTER O WITH STROKE
0xF9 0x00F9 [ù] [ù] LATIN SMALL LETTER U WITH GRAVE
0xFA 0x00FA [ú] [ú] LATIN SMALL LETTER U WITH ACUTE
0xFB 0x00FB [û] [û] LATIN SMALL LETTER U WITH CIRCUMFLEX
0xFC 0x00FC [ü] [ü] LATIN SMALL LETTER U WITH DIAERESIS
0xFD 0x00FD [ý] [ý] LATIN SMALL LETTER Y WITH ACUTE
0xFE 0x00FE [þ] [þ] LATIN SMALL LETTER THORN
0xFF 0x00FF [ÿ] [ÿ] LATIN SMALL LETTER Y WITH DIAERESIS

Basic PHP Syntax

* The word PHP stands for HyPertext Preprocessor. PHP is an open source software and free to use. This is a server side scripting language which means codes written in php are executed on server side.

* All PHP code block starts with <?php and ends with ?>. You can also use <script language="php"> </script>

* If shorthand support is enabled on the server then you can start a PHP scripting block with <? and end with ?>. Short tag are enabled via the short_open_tag php.ini configuration file directive, or if php was configured with the --enable-short-tags option.

* Each code line in PHP must end with a semicolon (;). Semicolon differentiates between two instructions.

* In PHP, with echo or print command you can show output text.A php file can contain html tags just like a normal html file.

* Note that the closing tag of a PHP block at the end of a file is optional.

* Two types of commenting code in php script is available. For single line comment use "//". To comment a large block write code inside /* and */


Below is an example of welcome.php.


<html>
<body>
<?php
echo "Welcome to the PHP World";?>
<br> </br>
</body>
</html>
<?php
echo "Welcome php";
?>


Save welcome.php inside htdocs folder (If you use apache web server) and run it from browser. The following will be output.


Welcome to the PHP World

Welcome php

Variables in PHP

In any programming language variables are the declaration which stands for value. In PHP, variables can be declared to store numbers, characters or any values. Variables can be used as many as you wish inside the script.

* In PHP all variables must start with $ sign. But we don't need to declare the data type of the variables. PHP automatically converts the variable to the correct data type, depending on how they are set. That's why PHP is called loosely typed language.

* The variable name in PHP is case-sensitive.

* A variable name must start with a letter or an underscore "_"

* A variable name can only contain alpha-numeric characters and underscores (a-z, A-Z, 0-9, _ and the bytes from 127 through 255 (0x7f-0xff). )

* It should not contain spaces.

* $this is a special variable that can't be assigned. By default, variables are always assigned by value. Note that PHP offers assignment of values to the variable by two ways, 1) Assign by expression. 2) Assign by reference (simply prepend an ampersand (&) to the beginning of the variable which is being assigned).


Following is an example of PHP variables using and displaying the value of the variables.


<html>
<body>
<?php
$variable1='This is string type variable';
$_variable2=100;
echo $variable1 . "<br />";
echo $_variable2. "<br />";

$variable3=&$_variable2;
$variable4=$_variable2;
echo "Variable3 value:" . $variable3 . "<br />";
echo "variable4 value:" . $variable4. "<br />";
$_variable2=200;
echo "After assignment to _variable2 Variable3 value:" . $variable3. "<br />";
echo "After assignment to _variable2 variable4 value:" . $variable4;
?>
</body>
</html>


The following is the output.


This is string type variable
100
Variable3 value:100
variable4 value:100
After assignment to _variable2 Variable3 value:200
After assignment to _variable2 variable4 value:100


Note that, in the case of "assign by reference" the value of the variable is change if reference value is changed but in case of "assign by expression" if source changes has no effect on assigned variable.

Oracle datatype internal code representation

As it is shown in oracle datatype internal code every datatype in oracle has its internal code. In this example every oracle datatype along with their corresponding internal code is shown.


Datatype Code
-------------------------------------- -------
1. VARCHAR2(size [BYTE | CHAR]) 01
2. NVARCHAR2(size) 01
3. NUMBER[(precision [, scale]]) 02
4. LONG 08
5. DATE 12
6. BINARY_FLOAT 21
7. BINARY_DOUBLE 22
8. RAW(size) 23
9. LONG RAW 24
10.ROWID 69
11.CHAR [(size [BYTE | CHAR])] 96
12.NCHAR[(size)] 96
13.CLOB 112
14.NCLOB 112
15.BLOB 113
16.BFILE 114
17.TIMESTAMP [(fractional_seconds)] 180
18.TIMESTAMP [(fractional_seconds)] WITH TIME ZONE 181
19.INTERVAL YEAR [(year_precision)] TO MONTH 182
20.INTERVAL DAY [(day_precision)] TO SECOND [(fractional_seconds)] 183
21.UROWID [(size)] 208
22.TIMESTAMP [(fractional_seconds)] WITH LOCAL TIME ZONE 231

Datatypes in Php

In Php you don't need to declare datatype of the variable. Based on the variable assignment value php automatically converts it to corresponding datatype. In php there is eight different datatypes.

A)Four Scalar Types:
1)Integer
2)Float/Double
3)String
4)Boolean

B)Two compound Types:
1)Array
2)Object

C)Two special types:
1)Resource
2)Null

The type of variable is decided at runtime by PHP depending on the context in which that variable is used.

* With var_dump() function you can check the type and value of an expression.


* With the gettype() function you can also get the type of the variable.


* With is_{type}() function you can check a certain type. The {type} within brace means that type should be replaced by any data type.

For Integer type checking the function is is_int()
For String type checking the function is is_string()


* To convert a variable from one type to another either use cast or use the settype() function.

To convert to integer type use the (int) or (integer) casts
To convert to boolean type use the (bool) or (boolean) casts.
To convert to string type use the (string) cast or the strval() function. Though string conversion is done automatically.
A boolean TRUE value is converted to the string "1" and boolean FALSE is converted to "" (the empty string) and vice-versa.

Below is an example:


<html>
<body>
<?php
$btype=FALSE;
$itype=10;
$ftype=100.1;
$stype="This is a String datatype.";
echo gettype($btype);
echo " ". (boolean)($btype); //Note that the display behaviour of boolean type is either null or 1.
echo "<br />";
echo gettype($itype);
echo " ".$itype;
echo "<br />";
echo gettype($ftype);
echo " ".$ftype;
echo "<br />";
echo gettype($stype);
echo " ". $stype;
echo "<br />";
?>
</body>
</html>


And the output is,


boolean
integer 10
double 100.1
string This is a String datatype.


Note that boolean TRUE or FALSE is treated differently in Php. If you display boolean FALSE expression, NULL will be printed and if you display boolean TRUE expression, 1 will be printed.

Boolean datatype in Php

The boolean datatype in php in considered specially. The boolean datatype expresses the truth value which can be either TRUE or FALSE.

Confusion may come while your print boolean datatype and while converting the value of boolean datatype variable.

When converting to boolean type the following values are considered as FALSE.

1)the boolean FALSE itself
2)the integer 0 (zero)
3)the float 0.0 (zero)
4)the empty string, and the string "0"
5)an array with zero elements
6)an object with zero member variables (PHP 4 only)
7)the special type NULL (including unset variables)
8)SimpleXML objects created from empty tags

Except the above 8 types all converted boolean type are considered as TRUE even a -1.

Whenever you print any boolean FALSE value it will print NULL and whenever you print any boolean TRUE value it will print 1 but never think that FALSE is NULL and 1 is a constant for TRUE. NULL is boolean value that indicates FALSE and 1 is a boolean value that indicates TRUE.

Symbolic constants are specifically designed to always and only reference their constant value. But booleans are not symbolic constants, they are values which means either true or false. So operate them like symbolic constants may have problems. Like (true+true) will print 2 but two boolean variable containing truth value TRUE adding will print 1.


<html>
<body>
<?php
$booleanTType=True;
$booleanFType=False;
echo 'Output of "(True)":'.$booleanTType ;
echo "<br />";
echo 'Output of "(False)":'. $booleanFType ;
echo "<br />";
echo (true+true);
echo "<br />";
echo 'Output of "(True+True)":'.($booleanTType+$booleanTTypes);
echo "<br />";
echo 'Output of "(False+False)":'.($booleanFType+$booleanFTypes) ;
?>
</body>
</html>

Output
Output of "(True)":1
Output of "(False)":
2
Output of "(True+True)":1
Output of "(False+False)":0

Integer and floating point number in Php

Integers in php can be declared as decimal, octal or hexadecimal.
To declare an octal precede the number with zero. (0)
To declare an hexadecimal precede the number with 0x.

The following is the declaration of integer types.
$decimal=786; //decimal positive
$decimalNegative=-12345; //decimal negative
$octalNumber=0123; //octal number
$hexNumber=0xA1B; //hexadecimal


The Integer size can be determined using the constant PHP_INT_SIZE.
The maximum size of the Integer can be determined using the constant PHP_INT_MAX.

The maximum value of Integer is platform dependent.

If Php encounters a value that is beyond integer type then it treats the value as float.

Some declaration of floating point numbers are,

$float1 = 1.234;
$floatExp1 = 4.5e7;
$floatExp2 = 10E-9;

Array declaration, assignment and printing in php

The term array comes in order to store multiple values in a single variable. In php with help of Array you can store multiple values in a single variable instead of defines multiple variables.
Each element in the array is accessed by the associated key value. A key may be either an integer or a string. By default if no key value is mentioned then it starts with 0.

Array declaration Syntax:
An array is created by the array()language construct.
Like,
$arrayName=array('Arju', 'Momin', 'Robert', 'Davis');

Here array key value is omitted. If array key value is omitted then first element is accessed by $variable_name[interger_key_value_start_from_0]
In this case $arrayName[0] have value Arju.
$arrayName[1] have the value Momin and so on.

Example 01:
The following is the php code,


<html>
<body>
<?php
$arrayName= array("Arju","Momin","Robert","Davis");
echo "This is first element :" . $arrayName[0];
echo "<br />";
echo "This is second element :" . $arrayName[1];
?>
</body>
</html>


Output
This is first element :Arju
This is second element :Momin

Example 02:
Below is an example where key value is assigned manually.
If a key is not specified for a value, the maximum of the integer indices is taken and the new key will be that value plus 1.


<html>
<body>
<?php
$arrayName["students"]= 48;
$arrayName[10]=100;
$arrayName[]=120; //120 assigned to key value 11 as maximum key is 10, so it is 10+1
echo "Total Students :" . $arrayName["students"];
echo "<br />";
echo "10th positioned student mark :" . $arrayName[10];
echo "<br />";
echo "11th positioned student mark :" . $arrayName[11];
?>
</body>
</html>


Output


Total Students :48
10th positioned student mark :100
11th positioned student mark :120



Example 03:
You can define multidimensional array by declaring array within an array.
Following is an example.


<html>
<body>
<?php
$student=Array
(
"Seven" => Array
(1 => 76 ,2 => 65 , 3 => 45 ),
"Eight" => Array
(10 => 87 , 89 ),
"Nine" => Array
( 23 => 98, 25 => 86 , 27 => 56 )
) ;

echo "Result of Roll number of 11 of class Eight is: " .$student['Eight'][11];
echo "<br />";
echo "Result of Roll number of 127 of class Nine is: " .$student['Nine'][27];
?>
</body>
</html>



Output
Result of Roll number of 11 of class Eight is: 89
Result of Roll number of 127 of class Nine is: 56

Modifying Array Values
In order to set an array just issue,
$arrayName[key_value]=new_value;
If the variable does not exist array will be created. So it is an another way to create array.

In order to remove element from the array issue,
unset ($arrayName[key_value]);

In order to the array itself issue,
unset $arrayname;


Example:
<?php
$arr = array(1,5);
$arr[] = 8; // This is the same as $arr[2] = 8;
print_r($arr);
$arr["x"] = 42; // Adds a new element to array.
unset($arr[1]); // Removes 2nd element from the array that is 5.
print_r($arr);
unset($arr); // Deletes whole element of the array
print_r($arr);
?>


In order to delete array element one by one issue,


foreach ($arr as $i => $value) {
unset($arr[$i]);
}

List of directory contents using array in php

Code
<html>
<body>
<?php
$fileHandler = opendir('C:\Documents and Settings');
while (false !== ($file = readdir($fileHandler))) {
$files[] = $file;
}
sort($files);
print_r($files);
closedir($fileHandler);
?>
</body>
</html>


Output
Array ( [0] => . [1] => .. [2] => A [3] => Administrator [4] => All Users [5] => Default User [6] => LocalService [7] => NetworkService [8] => apache2triad )

Track error messages on php

It is common in php that you write codes but whenever you tried to display on the web browser it displays nothing even a html. You want to know the behind where actually problem occurs. In which line or in which part of the code. The error_reporting function will help in this case really well.

Below is an example which is written to display directory contents inside c:\Documents and Settings folder but at the end on the browser it displayed nothing. You by enabling error reporting I might wish the say what actually happening there.

Code


<html>
<body>
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('html_errors', true);
$fileHandler = opendir('C:\Documents and Settings');
while (false !== ($file = readdir($filehandler))) {
$files[] = $file;
}
sort($files);
print_r($files);
closedir($filehandler);
?>
</body>
</html>


Output


Notice: Undefined variable: filehandler in C:\apache2triad\htdocs\array_file.php on line 8

Warning: readdir(): supplied argument is not a valid Directory resource in C:\apache2triad\htdocs\array_file.php on line 8

Warning: sort() expects parameter 1 to be array, null given in C:\apache2triad\htdocs\array_file.php on line 11

Notice: Undefined variable: filehandler in C:\apache2triad\htdocs\array_file.php on line 13

Warning: closedir(): supplied argument is not a valid Directory resource in C:\apache2triad\htdocs\array_file.php on line 13



Based on the output you are aware that there is problem with variable naming. As variable is case-sensitive in php so you can write the code as,


<html>
<body>
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('html_errors', true);
$fileHandler = opendir('C:\Documents and Settings');
while (false !== ($file = readdir($fileHandler))) {
$files[] = $file;
}
sort($files);
print_r($files);
closedir($fileHandler);
?>
</body>
</html>

Running perl fails perl lib version doesn't match executable version

Problem Description
Whenever you wish to use perl it did not run failing with perl lib version doesn't match executable version. Even it happens whenever you wish to know the version of the perl as shown below.
C:\>perl.exe -V
Perl lib version (v5.8.3) doesn't match executable version (v5.8.7) at E:\oracle\product\10.2.0\db_1\perl\5.8.3\lib/MSWin32-x86-multi-thread/Config.pm line 32.
Compilation failed in require.
BEGIN failed--compilation aborted.

Cause and Solution of the Problem:
As the error indicates executable version of perl(perl.exe) does not match it library version which is under MSWin32-x86-multi-thread/Config.pm. This is a possible problem if you install perl two times that have different version in your hand. Note that many software includes perl software. So if you install other software then perl can be integrated with it. If you have oracle database then already perl is there. If you install any web (server+ php) then perl may be integrated with the installation.

The solution is use the same perl executable version as of library version. Suppose if I select executable version of 5.8.3 then it will solve my problem.

C:\>E:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe -V
Summary of my perl5 (revision 5 version 8 subversion 3) configuration:
Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:

March 10, 2009

List of Parameters that must have identical in RAC database

In a RAC database there may contain several instances and the initialization parameters of all of the instances should not have identical setting. In fact the initialization parameters that are critical for database creation and affect certain database operations must have the same value for every instance in an Oracle RAC database.

Below is the list of initialization parameters that must have identical settings for all instances in a RAC database.

1)ACTIVE_INSTANCE_COUNT

2)ARCHIVE_LAG_TARGET

3)CLUSTER_DATABASE

4)CLUSTER_DATABASE_INSTANCES

5)COMPATIBLE

6)CONTROL_FILES

7)DB_BLOCK_SIZE

8)DB_DOMAIN

9)DB_FILES

10)DB_NAME

11)DB_RECOVERY_FILE_DEST

12)DB_RECOVERY_FILE_DEST_SIZE

13)DB_UNIQUE_NAME

14)DML_LOCKS (Only if set to zero).

15)INSTANCE_TYPE (RDBMS or ASM)

16)PARALLEL_MAX_SERVERS

17)REMOTE_LOGIN_PASSWORD_FILE

18)UNDO_MANAGEMENT

How to avoid of recreating pfile or spfile if any error in spfile

Let us some talk about pfile and spfile. Suppose I have done some wrong-edit inside spfile using ALTER SYSTEM SET ... SCOPE=SPFILE from database. Now the next startup process of my database will fail with oracle errors. The conventional approach of solution to this problem is,
1)Connect to SQL*plus as sysdba
2)Create pfile from the spfile.
3)Edit the pfile and correct the parameter settings.
4)Create spfile from the edited correct pfile.
5)Startup your database with the spfile.

But we can omit these steps easily by just creating a pfile and invoke the name of the spfile inside the pfile. After invoking spfile parameter inside pfile in the next line specify the name of the parameter which is cause problem of startup. In this case we gave multiple values of the parameter and oracle will use the last one. So override the invalid parameter value with the valid one and thus will startup the create. After startup we can set valid value in the spfile.

The following example will make you a clear idea.

Step 1:
I have set background_dump_dest parameter to an invalid location in the spfile.
SQL> alter system set background_dump_dest='/oradata2/testing' scope=spfile;
System altered.

Now shutdown the database and start it up.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-00444: background process "MMAN" failed while starting
ORA-07446: sdnfy: bad value '' for parameter .

Step 2:
Startup fails as we set invalid location to background_dump_dest. Now create a pfile with an entry of spfile and give the location of the spfile. After specify specify the parameter which cause problem(background_dump_dest) and use the valid value. This setting will override the setting inside spfile and thus will help to startup the database.

SQL> !vi /oradata2/mypfile.ora
spfile=/oracle/app/oracle/product/10.2.0/db_1/dbs/spfilearju.ora
background_dump_dest='/oradata1'

Step 3:
Now start the database with newly created pfile. In fact spfile.
SQL> startup pfile=/oradata2/mypfile.ora
ORACLE instance started.

Total System Global Area 234881024 bytes
Fixed Size 2019800 bytes
Variable Size 113249832 bytes
Database Buffers 113246208 bytes
Redo Buffers 6365184 bytes
Database mounted.
Database opened.

Step 4:
And it worked!!! Now set valid value to the parameter background_dump_dest inside spfile.

SQL> show parameter background_dump_dest

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
background_dump_dest string /oradata1

SQL> alter system set background_dump_dest='/oradata1' scope=spfile;
System altered.

In this way we can minimize our steps as well as downtime.

Why create between pfile and spfile works if shutdown database

Sometimes it may arises question that while database is shutdown then you can still connect to database as sysdba and now issue create spfile from pfile or create pfile from spfile and it works fine. But database is shutdown and then how oracle maintains where is spfile and pfile.

The answer is create pfile and spfile can only can done whenever you connect as sysdba. And if you connect as sysdba then a dedicated server is established which does that create operation.

You can easily find it. Suppose I am log on to my unix machine and invoke the status of process arju.
-bash-3.00$ ps -ef |grep arju
oracle 27060 1 0 04:58:09 ? 0:07 oraclearju (LOCAL=NO)
oracle 26970 1 0 04:54:43 ? 0:21 ora_ckpt_arju
oracle 26974 1 0 04:54:43 ? 0:00 ora_reco_arju
oracle 16423 16224 0 23:00:25 pts/3 0:00 grep arju
oracle 27024 1 0 04:55:00 ? 0:08 oraclearju (LOCAL=NO)
oracle 27028 1 0 04:55:15 ? 0:08 oraclearju (LOCAL=NO)
oracle 26972 1 0 04:54:43 ? 0:04 ora_smon_arju
oracle 26976 1 0 04:54:43 ? 0:21 ora_cjq0_arju
oracle 26982 1 0 04:54:44 ? 0:00 ora_d000_arju
oracle 27030 1 0 04:55:15 ? 0:37 oraclearju (LOCAL=NO)
oracle 26964 1 0 04:54:43 ? 0:02 ora_mman_arju
oracle 26994 1 0 04:54:49 ? 0:01 ora_arc1_arju
oracle 27002 1 0 04:54:50 ? 0:00 ora_qmnc_arju
oracle 27032 1 0 04:55:15 ? 0:10 oraclearju (LOCAL=NO)
oracle 26968 1 0 04:54:43 ? 0:09 ora_lgwr_arju
oracle 27022 1 0 04:55:00 ? 0:01 ora_q000_arju
oracle 26980 1 0 04:54:44 ? 0:35 ora_mmnl_arju
oracle 26984 1 0 04:54:44 ? 0:00 ora_s000_arju
oracle 26962 1 0 04:54:43 ? 0:03 ora_psp0_arju
oracle 26966 1 0 04:54:43 ? 0:06 ora_dbw0_arju
oracle 26978 1 0 04:54:43 ? 0:07 ora_mmon_arju
oracle 26960 1 0 04:54:43 ? 0:16 ora_pmon_arju
oracle 26992 1 0 04:54:49 ? 0:01 ora_arc0_arju
oracle 27040 1 0 04:55:52 ? 0:00 ora_q002_arju

Now I connect as sysdba and see the status.
-bash-3.00$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 8 23:00:31 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> !ps -ef |grep arju
oracle 27060 1 0 04:58:09 ? 0:07 oraclearju (LOCAL=NO)
oracle 26970 1 0 04:54:43 ? 0:21 ora_ckpt_arju
oracle 26974 1 0 04:54:43 ? 0:00 ora_reco_arju
oracle 16433 1 0 23:00:33 ? 0:00 ora_m001_arju
oracle 16429 1 1 23:00:30 ? 0:00 ora_j000_arju
oracle 27024 1 0 04:55:00 ? 0:08 oraclearju (LOCAL=NO)
oracle 27028 1 0 04:55:15 ? 0:08 oraclearju (LOCAL=NO)
oracle 26972 1 0 04:54:43 ? 0:04 ora_smon_arju
oracle 26976 1 0 04:54:43 ? 0:21 ora_cjq0_arju
oracle 26982 1 0 04:54:44 ? 0:00 ora_d000_arju
oracle 27030 1 0 04:55:15 ? 0:37 oraclearju (LOCAL=NO)
oracle 26964 1 0 04:54:43 ? 0:02 ora_mman_arju
oracle 26994 1 0 04:54:49 ? 0:01 ora_arc1_arju
oracle 27002 1 0 04:54:50 ? 0:00 ora_qmnc_arju
oracle 27032 1 0 04:55:15 ? 0:10 oraclearju (LOCAL=NO)
oracle 26968 1 0 04:54:43 ? 0:09 ora_lgwr_arju
oracle 27022 1 0 04:55:00 ? 0:01 ora_q000_arju
oracle 26980 1 0 04:54:44 ? 0:35 ora_mmnl_arju
oracle 16431 16430 0 23:00:31 ? 0:00 oraclearju (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 26984 1 0 04:54:44 ? 0:00 ora_s000_arju
oracle 26962 1 0 04:54:43 ? 0:03 ora_psp0_arju
oracle 16436 16434 0 23:00:34 pts/3 0:00 grep arju
oracle 26966 1 0 04:54:43 ? 0:06 ora_dbw0_arju
oracle 26978 1 0 04:54:43 ? 0:07 ora_mmon_arju
oracle 26960 1 0 04:54:43 ? 0:16 ora_pmon_arju
oracle 26992 1 0 04:54:49 ? 0:01 ora_arc0_arju
oracle 27040 1 0 04:55:52 ? 0:00 ora_q002_arju
oracle 16434 16430 0 23:00:34 pts/3 0:00 /usr/bin/bash -c ps -ef |grep arju

Here you see a dedicated server is established as you connect as sysdba.
Now shutdown database and see the process status.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !ps -ef |grep arju
oracle 16540 16430 0 23:04:37 pts/3 0:00 /usr/bin/bash -c ps -ef |grep arju
oracle 16542 16540 0 23:04:37 pts/3 0:00 grep arju
oracle 16431 16430 1 23:00:31 ? 0:01 oraclearju (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

We still see the dedicated server as we still connect to as sysdba.
Now exit from connecting as sysdba and observe the result.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
-bash-3.00$ ps -ef |grep arju
oracle 16544 16224 0 23:04:44 pts/3 0:00 grep arju

Nothing here now.