Special Character in Char column
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
Special Character in Char column
I have teradata table which has a column of type char(30), and in my job i have a transform just before inserting into this Teradata table. i am passing a value 'RSH_PROD_DTL' into this column, but when i query select * from <table_name> where <column_name>= 'RSH_PROD_DTL' ; it returns nothing and when i say select * from <table_name> where <column_name> Like 'RSH_PROD_DTL%' ; it returns the desired records. so i tthink there is some special charater inserted for rest of the space in column, can anyone suggest please how to handle this.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Yes, Char fields are padded. The default pad character is set with an environment variable (APT_DEFAULT_STRING_PADCHAR if I remember correctly), but can be overridden down to the individual column level. Right click on the column in the Columns grid to open the editor and find the pad character property.
The default default value is \x00 (the ASCII "NUL" character). You can specify the space character as a space, as \040 (octal representation) or \x20 (hexadecimal representation).
The default default value is \x00 (the ASCII "NUL" character). You can specify the space character as a space, as \040 (octal representation) or \x20 (hexadecimal representation).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia