Ascii Values in Database

Assalamualaykum Wr Br…I was looking into one value in database for a table named Customer which have column as Gender. The value in column should be either M or F or Null, but cannot have any other value.System throws exception when there is a mismatch of the value specified above.
The data of the table is fed from file.Before Customer table, data is first stored in temporary table then certain validations then moved to customer table. My Client stated that Gender value in file was null and it is temporary table which is showing as null but does not go in Customer acutal table.
When I queried in data as
select * from customer_temp where gender is not null
gives me result set, if I use where gender is null then does not provide result.
Inorder to find the exact value in gender column, I used the following query:
select ASCII(gender) from customer_temp where gender is not null
The above query displayed the value as 13 which is value of carriage return(\n).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s