Inserting into a not null column.
Moderators: chulett, rschirm, roy
Inserting into a not null column.
Can Datastage insert spaces into a column defined as NOT NULL?
I tried to insert space in a column defined as not null but the job fails.
I tried to insert space in a column defined as not null but the job fails.
ps
What's the target database and loading method? Most bulk loaders default to assuming a single space into a CHAR type target column should be interpreted as a NULL. There's switches you need to set to alter that behavior. More information please.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Nah... I'd wager it's a settings issue as Ken notes. You usually have to tell your process to 'PRESERVE_BLANKS' in some fashion otherwise they typically get stripped. Then your space gets turned into an empty string and blows the NOT NULL constraint.
More information please.![Wink :wink:](./images/smilies/icon_wink.gif)
More information please.
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
The target database is Oracle and the write_method=load. The target column is defined as not null.
My input file consists of:
record nullable
{final_delim=none, record_length=fixed, record_delim_string='\n', delim=none, quote=none}
(
code:not_nullable string[1] {width=1};
)
I get an error saying inserting null into a not null column.
Please let me know if you need more info. Thanks
My input file consists of:
record nullable
{final_delim=none, record_length=fixed, record_delim_string='\n', delim=none, quote=none}
(
code:not_nullable string[1] {width=1};
)
I get an error saying inserting null into a not null column.
Please let me know if you need more info. Thanks
ps
-
- Participant
- Posts: 437
- Joined: Fri Oct 21, 2005 10:00 pm
APT_ORACLE_PRESERVE_BLANKS. Its under the Operator Specific environmental variables.
Keith Williams
keith@peacefieldinc.com
keith@peacefieldinc.com
Size in DB
Hello All,DSguru2B wrote:Time to mark your post as "Resolved".
I have found that using APT_ORACLE_PRESERVE_BLANK = True option also Pads blank spaces behing the passed string.
i.e. eventhough i pass only 5 characters to a field defined as Varchar 30, in database it is actually stored as 30 instead of 5.
Database: Oracle
Wrtite Mode: LOAD -> Replace
Please suggest how to resolve this issue.
Thank You
Satish
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: