UDB error trying to do an Update

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

Post Reply
JPalatianos
Premium Member
Premium Member
Posts: 306
Joined: Wed Jun 21, 2006 11:41 am

UDB error trying to do an Update

Post by JPalatianos »

Hi,
We have a job that has one ODBC as input a transformer and then 2 ODBC's as output and 1 DB2_UDB_API as output. Th columns bein fed to the failing stage are CNTR_NO char(6) and CNTR_LENGTH Integer. The job is failing on the DB2_UDB_API stage with:

DB2_UDB_API_63,0: Warning: GPFRI_CNTRCT_RULE_002_JPtest.DB2_UDB_API_63: [IBM][CLI Driver][DB2/AIX64] SQL0206N "ORCHESTRATE.CNTR_LENGTH" is not valid in the context where it is used. SQLSTATE=42703

We are trying the User defined SQL:
UPDATE PRFWSTG.GPFRI_DATA A
SET A.USG_CD = 'N',
A.RSN_CD = '02'
WHERE
(RIGHT(A.CNTR_NO,ORCHESTRATE.CNTR_LENGTH) = ORCHESTRATE.CNTR_NO);

I am attempting to help out a developer in our shop and thought by specifying Orchestrate in his SQL it would resolve his issue.

I then tried
UPDATE PRFWSTG.GPFRI_DATA A
SET A.USG_CD = 'N',
A.RSN_CD = '02'
WHERE
RIGHT(A.CNTR_NO,6) = ORCHESTRATE.CNTR_NO;

and I received a similar error for ORCHESTRATE.CNTR_NO:
DB2_UDB_API_63,0: Warning: GPFRI_CNTRCT_RULE_002_JPtest.DB2_UDB_API_63: [IBM][CLI Driver][DB2/AIX64] SQL0206N "ORCHESTRATE.CNTR_NO" is not valid in the context where it is used. SQLSTATE=42703

The following worked:
UPDATE PRFWSTG.GPFRI_DATA A
SET A.USG_CD = 'N',
A.RSN_CD = '02'
WHERE
RIGHT(A.CNTR_NO,6) = CNTR_NO;

My question is how can we pass the value of CNTR_LENGTH coming in from the link to the Right function (instead of the hard coded 6 that worked)?

Thanks - - John
JPalatianos
Premium Member
Premium Member
Posts: 306
Joined: Wed Jun 21, 2006 11:41 am

Post by JPalatianos »

After looking at the job and database for the developer I realized that the issue was he was using an outdated Table definition for his metadata.
This isssue has been resolved.
Thanks - - John
Post Reply