Db2 : Unable to convert the adapter spec ostrstream object

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
bandish
Participant
Posts: 41
Joined: Tue Oct 11, 2005 1:30 am

Db2 : Unable to convert the adapter spec ostrstream object

Post by bandish »

Hi,

I am getting the following error while trying to insert into DB2 table using DB2 Enterprise stage.

Db2udb_SCR_TYPE_REAS: Unable to convert the adapter spec ostrstream object with a value of `' to ustring.

The query in the Db2 stage is as follows:

INSERT
INTO
TEDCDW.SCR_TYPE_REAS
(SCR_TYPE_REAS_I, ETL_PRCS_EFF_TS, SCR_TYPE_I, SCR_REAS_VAL_I, ETL_PRCS_END_TS, PRCS_RUN_I, JOB_EXEC_I)
(select SCR_TYPE_REAS_I, ETL_PRCS_EFF_TS, SCR_TYPE_I, SCR_REAS_VAL_I, ETL_PRCS_END_TS, PRCS_RUN_I, #JPM_JOB_EXEC_ID# AS JOB_EXEC_I
from TEDCSTG.SCR_TYPE_REAS_W
)

Any help appreciated.

Thanks
Bandish
trobinson
Participant
Posts: 208
Joined: Thu Apr 11, 2002 6:02 am
Location: Saint Louis
Contact:

Post by trobinson »

In the select part of the insert what's this?
#JPM_JOB_EXEC_ID# AS JOB_EXEC_I

Try just

'#JPM_JOB_EXEC_ID#'

note the tick <parameter> tick.

I'm assuming you want the JOB_EXEC_ID to be a literal inserted into the table and to be the value of a job parameter.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Since it's in the position of an identifier (column name in this case) try double quotes around the parameter reference, making it a "delimited identifier". I'm far from certain that column names can be parameterized in this way. Most solutions rely on making the entire SQL statement a single parameter; if you can't get anything else to work, then maybe you could try that as an approach.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply