update insert problem

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
jayawant_hsbc
Participant
Posts: 7
Joined: Wed Jan 05, 2005 11:05 pm

update insert problem

Post by jayawant_hsbc »

hi guys i am firing this user defined query in my target database it needs to update only one column and insert new rows
UPDATE dwhd004.DWH_ARR_RATE_REL SET END_DT=CURRENT_DATE WHERE START_DT=? and arr_id_acct=?;
INSERT INTO dwhd004.DWH_ARR_RATE_REL (ARR_ID_ACCT,START_DT,RI_ID_SRCE_SYS,EFF_RATE_PCT,INT_NET_EFF_RATE,INT_CEIL_RATE,INT_FLOOR_RATE,INT_TRNSF_RATE,INT_RPRC_SPRD_RATE,INT_RPRC_IDX_RATE,INT_CURR_RATE,FUND_CHRG_RATE,BASIS_POINT_NUM,RATE_CLASS_LCL_CDE,RATE_CLASS_CDE,INDEX_RPRC_LCL_CDE,INDEX_RPRC_CDE,ACCR_BASIS_LCL_CDE,ACCR_BASIS_CDE,ACCR_FUND_CDE,RATE_TEXT,END_DT,ACCR_FUND_LCL_CDE,PRD_CEIL_RATE_PCT,PRC_FLR_RATE_PCT) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);
and iam getting the following error

no_jndsjLodLoanArrAfs..UDB_DWH_ARR_RATE_REL_lod: [IBM][CLI Driver] CLI0100E Wrong number of parameters. SQLSTATE=07001
SQLExecDirect: Error executing statement 'UPDATE dwhd004.DWH_ARR_RATE_REL SET END_DT=CURRENT_DATE WHERE START_DT=? and arr_id_acct=?'. See following DB2 message for details.
no_jndsjLodLoanArrAfs..UDB_DWH_ARR_RATE_REL_lod.DSLink1: DSP.Open GCI $DSP.Open error -100.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

A quick cut and paste of your statement shows it has 48 commas, so that would mean that you ought to have 24 column; but only 15 of those are in your value fields. So it would seem your columns and placeholds don't add up to the same number, which is also what the error message states.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

However, it's grumbling about the UPDATE statement. Wrong number of parameters suggests that, while you have two columns in your WHERE clause, there are more than two - or only one - identified as Key in your metadata (the columns grid). Or, perhaps, that either START_DT or arr_id_acct are not columns in this table, or dwhd004.DWH_ARR_RATE_REL can not be found as a table. I take it CURRENT_DATE is a legitimate constant (not SYSDATE?) in your brand of SQL?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Madhav_M
Participant
Posts: 43
Joined: Sat Jul 10, 2004 5:47 am

Post by Madhav_M »

Hi Jayawant,

The smartest way could be in the target stage chane the sql generation to
"auto insert/update" and then import the metadata.

so u will find all the columns automatically in the insert & update sections, then go for editing.

Hope this helps.

Thanks
Madhav
Post Reply