473,657 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2049
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
13434
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 strings) at least 12 digits (characters) long - all positions will be occupied (no leading 0's) - Tables may have upto 1m+ rows
4
2776
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. It's as if char now is a signed datatype,
2
1392
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 int(all the values in this column are already numbers) I am not trying to move the data from the production database into the blank database using DTS and the fields that had their datatypes changed are getting dropped by dts. Is there anyway...
2
1581
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 jdbc application which interacts with the db2 8.2 (ESE windows) database through a DB2 6.1 windows Client. Java Version --> JDK 1.4.2_07
14
3007
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 precision. I am trying to assess my applications performance difference using FK using BYTE instead of LONG type. and not enforcing integrity at the database level. (ie, Form level). This only becomes SIGNIFICANT when the field is used highly in...
1
2410
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 OleDbDataReader schema) is set by the first data row and that causes a problem if any of the subsequent rows in that column holds a diffrent datatype Exampl Zi ------ 2926 9474
0
1180
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 from xml if the properties having char datatypes have numeric values(0-9) then everything worls fine. If I put any letter e.g. A it starts throwing exception - "Input string is not in correct format". If I convert these properties to string, all...
4
1409
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 Abhishek
0
1265
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 `directory | grep ASCII | cut -f1 -d":"` do ..something.. done;
0
8316
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8833
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8509
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8610
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2735
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.