DB2 EE Stage ERROR While Deleting Data

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
daniel0623
Charter Member
Charter Member
Posts: 34
Joined: Tue May 31, 2005 8:17 pm
Location: ShangHai,China

DB2 EE Stage ERROR While Deleting Data

Post by daniel0623 »

Hello guys,
While Deleting Data by DB2 EE Stage,Error as follows:
DB2_UDB_Enterprise_1: Unable to convert the adapter spec ostrstream object with a value of `' to ustring.
DB2 is remote DB.It's normal while insert,update,select.If any one ever resovled similar problem, please help me.

Thanks
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Daniel,

I recall having had a similar problem sometime in the past; it had to do with the way that the custom SQL was interpreted - so my question would be whether or not you are using your own SQL in the stage or using generated code? If it is custom, could you perhaps post it?
daniel0623
Charter Member
Charter Member
Posts: 34
Joined: Tue May 31, 2005 8:17 pm
Location: ShangHai,China

Post by daniel0623 »

Hello ArndW,
User-defined SQL as follows, it is very easy:
DELETE FROM testtb WHERE (Col1='aaaaaaaaaa')
RobinM
Charter Member
Charter Member
Posts: 25
Joined: Wed Feb 15, 2006 5:18 am
Location: London

Re: DB2 EE Stage ERROR While Deleting Data

Post by RobinM »

daniel0623 wrote:Hello guys,
While Deleting Data by DB2 EE Stage,Error as follows:
DB2_UDB_Enterprise_1: Unable to convert the adapter spec ostrstream object with a value of `' to ustring.
DB2 is remote DB.It's normal while insert,update,select.If any one ever resovled similar problem, please help me.

Thanks
I realise this was posted a while back but maybe this will help people in the future:

I was getting this same error, when I had a DB2 EE stage delete step, with a Row Generator feeding into it. The RG was generating a column called DUMMY.

The problem was that I was not using the column in my DELETE sql (user-defined).

When I changed the DELETE SQL to include
WHERE ORCHESTRATE.DUMMY = 'DUMMY'
it worked fine (obviously setting the rg to generate the column with the value of 'DUMMY')

[edit]I'm not certain that this works - the error has now gone, but the DELETE doesn't seem to be happening! I'll update this as and when I find out what's going on.[/edit]
RobinM
Charter Member
Charter Member
Posts: 25
Joined: Wed Feb 15, 2006 5:18 am
Location: London

Re: DB2 EE Stage ERROR While Deleting Data

Post by RobinM »

RobinM wrote:[edit]I'm not certain that this works - the error has now gone, but the DELETE doesn't seem to be happening! I'll update this as and when I find out what's going on.[/edit]
I've got to the bottom of this, kind of. My delete wasn't working because sometimes the Delete stage would reject the dummy input record, and so I'm guessing ORCHESTRA.DUMMY would be null (?) but certainly not 'DUMMY' which was the predicate necessary.

I've changed the job to instead have a DB2 EE stage -> peek, doing a dummy query in the SQL and the delete statement in the open command - and this works.
daniel0623
Charter Member
Charter Member
Posts: 34
Joined: Tue May 31, 2005 8:17 pm
Location: ShangHai,China

Post by daniel0623 »

HI RobinM,
Thanks for your suggestion.It seems that DB2 EE stage can only delete rows which are same as input data.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

I am able to resolve the problem :D .

Code: Select all

UPDATE CDW_STG.EMPLOYEE_DIM SET CDW_STG.EMPLOYEE_DIM.INSERT_UPDATE_CODE=ORCHESTRATE.INSERT_UPDATE_CODE 
WHERE CDW_STG.EMPLOYEE_DIM.INSERT_UPDATE_CODE IS NOT NULL
Since I am mapping a dummy row from a transformer I have to use it in my sql. I set the corrsponding mapping for the column INSERT_UPDATE_CODE in transformer as SetNull().
And it works fine.
Kris

Where's the "Any" key?-Homer Simpson
RobinM
Charter Member
Charter Member
Posts: 25
Joined: Wed Feb 15, 2006 5:18 am
Location: London

Post by RobinM »

RobinM wrote:I've got cases open for both of these so I'll see what they say.
For info, this has been acknowledged as a bug and an eCase (90539) has been raised.
Image
Robin Moffatt, London, UK
Time flies like the wind, fruit flies like like a pear
Post Reply