Oracle Error ORA-24507: invalid combination of character set ids

Oracle Error Message

ORA-24507: invalid combination of character set ids

Reason for the Error

Attempts to set one character set id as zero

Solution

Set both charset and ncharset as zero or non-zero in OCIEnvNlsCreate()