sqlcode is: -2290

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

sqlcode is: -2290

Post by gssr »

I am updating and inserting the table with the following job

Dataset --> Transformer --> Oracle -->Reject

While executing it throws me the following errorm

Code: Select all

Orac_load,1: Open failed for insert:
insert is: (<Insert Query>
)
sqlcode is: -2290
esql complaint: ORA-02290: check constraint (Column Constraint) violated
I searched dsx, and found
viewtopic.php?t=127128&highlight=sqlcode+is%3A+-2290

Its not helping ,so need more help....
RAJ
nikhilanshuman
Participant
Posts: 58
Joined: Tue Nov 17, 2009 3:38 am

Post by nikhilanshuman »

A simple solution is to add constraint in transformer stage on the incoming data to verify if it is satisfying the check constraint which is defined in the table.If it is satisfying the constraint,then only pass data to target OCI stage.

For example : Suppose there is a table "Emp".It contains a column "Salary".There is a check constraint which says the salary must be greater than 2000(i.e. salary>2000).in this case,in the transformer you will have to add a constraint salary>2000.In this way,OCI stage will get only those valid records which satisfy the check constraint.

Rejecting records which violate the check constraints :

=> From transformer take a link for "otherwise".This link will contain all the data which has violated the check constraint.
=>add a funnel to capture the invalid data from tranformer as well as the OCI reject link.
=>In this way the data can be captured as well.
Nikhil
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

Thanks for your thoughts Nikhil,

Actually we got more than 20 constraints in the table

Its not possible to get all that in to the transformer...

Actually, i dont know why this error is arising??
Can you give me the root cause about this...

Thyanks in advance
RAJ
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:? How is that other post not helping? In short you need to understand why you are violating that check constraint (look it up in the database or talk to your DBA if you are unsure) and then ensure in your job that you pass only "good" values to that column. That could mean setting "bad" ones to a default value or not sending the record to the database at all... depends on your requirements.

Doesn't matter how many there are, check them all if you're unsure which one you're violating. And just specifically look at check constraints rather than constraints in general on the table. Most of the time they will be of the simple "is not null" variety but could also be enforcing a list of valid values (etc).
-craig

"You can never have too many knives" -- Logan Nine Fingers
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

I can understand that by using Nikhil solution ,i can get the same output.

But, i want to know which is the cause for this ERROR!!

Any idea :idea: :?:

I am currently trying to implement Nikhil's design, and post the update asap.
RAJ
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

gssr wrote:But, i want to know which is the cause for this ERROR!!

Any idea :idea: :?:
You violated a check constraint, nothing more and nothing less. Talk to your DBA if that is still unclear for some reason. You need to know what check the constraint is enforcing before you'll have a clue what the actual "cause" is.
-craig

"You can never have too many knives" -- Logan Nine Fingers
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

i checked with the constraint, and it is

Code: Select all

Ord_ind in (1,2,3,4,5,6)
The insert records are all having 6 as Ord_ind

But Still it was throwinmg the same error..

:cry:
RAJ
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then perhaps there's another constraint or you aren't really sending the "6" that you think you are. Any chance it's something silly like a "6 " coming in?
-craig

"You can never have too many knives" -- Logan Nine Fingers
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

I am just passing 3 record only , I can view the records in the input dataset as ORD_IND is all 6

In the error message, i am getting only this constraint as Violated!!
:roll:
RAJ
nikhilanshuman
Participant
Posts: 58
Joined: Tue Nov 17, 2009 3:38 am

Post by nikhilanshuman »

gssr wrote:I am just passing 3 record only , I can view the records in the input dataset as ORD_IND is all 6

In the error message, i am getting only this constraint as Violated!!
:roll:
put a peek stage after transformer and see what is actually going to target.The column value will be visible in the job log.

Check if the column mapping is proper.

Try hard coding the value in the transformer to 1 or 2..... :?
Nikhil
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

I tried to get into another dataset in target, and i can able to view it in the target output!!
I will try to use a peek stage and update about the feedback
RAJ
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

I checked the DDL of the table with constraint

Code: Select all

ALTER TABLE Test.Table1
ADD CONSTRAINT CHK_ORD_IND CHECK
(ORD_IND IN(0,1,2,3,4,5,6,7,8))
 ENABLE
;

Is that correct to mention
(ORD_IND IN(0,1,2,3,4,5,6,7,8)) INSTEAD OF (ORD_IND IN (0,1,2,3,4,5,6,7,8))
Anything this may cause!!!
RAJ
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

gssr wrote:
(ORD_IND IN(0,1,2,3,4,5,6,7,8)) INSTEAD OF (ORD_IND IN (0,1,2,3,4,5,6,7,8))
Anything this may cause!!!
8) in the above is actually '8' and ')'
RAJ
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Is the only difference the space after the "IN" verb? No, that makes no difference, both are equally valid.

We know. If you enable the "Disable Smilies" option in that post, that would fix that. 8)
-craig

"You can never have too many knives" -- Logan Nine Fingers
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

I dropped the Constraint in the table, the job works fine now,

Still could not able to get the error Source !!! :roll:

Thanks for your Thoughts!!!!
8)
RAJ
Post Reply