473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

CHAR datatype issue

Hi,

I have a column of datatype CHAR(20).
When the DataStage job loads data of length 15 into it, it pads the
remaining 5 spaces with blank space.
This is happening with all CHAR datatype fields.
Is there any global setting which is causing this? Any other ideas?

Thanks in advance.

Cheers,
San.

Jun 28 '06 #1
1 2036
shsandeep wrote:
Hi,

I have a column of datatype CHAR(20).
When the DataStage job loads data of length 15 into it, it pads the
remaining 5 spaces with blank space.
This is happening with all CHAR datatype fields.
Is there any global setting which is causing this? Any other ideas?

Thanks in advance.

Cheers,
San.

This is the standard behavior for CHAR columns, in every DBMS I know
about. If you don't want this padding behavior, recreate the database
with CHAR(20) replaced by VARCHAR(20). In general it's good practice to
use VARCHAR whenever the length is greater than one and you're not sure
every value will be the same length. state_abbr char(2) vs state_name
varchar(20) demonstrates the different usages quite well. Another
advantage is that VARCHAR columns can be resized (upward at least)
without dropping and recreating the entire table.
Jun 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Sanjay Minni | last post by:
What is the datatype to be used for Primary Key columns for most optimised access given that - There will be a single column primary key only - The values will only be integers (but as...
4
by: TK | last post by:
I have encountered a very strange bug. I am using a variable defined as: char ch; If I assigned a character like 'Ö' (ascii 153) with a statement like: ch = 'Ö'; It gets the value -103....
2
by: tdmailbox | last post by:
I have a production application that I am building some upgrades using a second (empty) copy the database. A few of the upgrades included changing the datatypes of a few fields from varchar to...
2
by: dotyet | last post by:
Hi Everyone, We recently migrated our database server from DB2 6.1 FP11 windows to 8.2 FP 8 windows. The migration was successful, without showing any signs of failure of any sort. We have a...
14
by: Elias Farah | last post by:
Hi All, What are people's experience in timing Query Performance? I have tried in vain, but get many unpredictable results, with execution proceeding in the background and problems of timing...
1
by: Teddy | last post by:
Language: C Excel Reading Method: ExecuteReade I am currently running into a challenge reading excel data when datatype formats are different in the SAME column. It seems like datatype (in the...
0
by: swatisahasrabudhe | last post by:
I have a class that I serialize/deserialize using xmlserializer. There are a few properties with char datatype. I have a few xml files from which I want to create the objects. While deserializing...
4
by: Abhishek | last post by:
Hi All, i need to find the address of a variable which is of the type system.drawing.bitmap which is a managed datatype. how to i get the address of the variable created of that type regards...
0
by: PALL | last post by:
hi, i am in a situation where i has to grep all the files with datatype other than filetype = data.. right now i am doing grep files other than ASCII by using following.. for file in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.