cannot insert data in oracle table

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

abyss
Premium Member
Premium Member
Posts: 172
Joined: Thu May 22, 2014 12:43 am

cannot insert data in oracle table

Post by abyss »

hi
i am a newbie for DS.
i am running a simple practice parallel job on data stage data is read from CFF then it go to remove duplicate stage and finally insert into the oracle table.
when i run the job, all stages can run successfully except the last stage, i can't insert data into oracle table. the insert statement i used is really simple:
INSERT INTO customer_dim (CUSTOMER_ID) VALUES (ORCHESTRATE.CUSTOMER_ID) but ds says the sql statement failed The OCI function OCIStmtExecute returned status -1. Error code: 24,381

any idea?
thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That error doesn't tell us much. As noted in another post with the same errors you'll need to provide us with details on exactly what you are doing in the target stage before anyone can really help much.
-craig

"You can never have too many knives" -- Logan Nine Fingers
abhilashnair
Participant
Posts: 284
Joined: Fri Oct 13, 2006 4:31 am

Post by abhilashnair »

You may need to check if any Primary/Unique Key constraint violations are happening
abyss
Premium Member
Premium Member
Posts: 172
Joined: Thu May 22, 2014 12:43 am

Post by abyss »

craig, is it possible to upload image on this form?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sure. You can upload an image to any of the free File Sharing sites out there (I typically use Imgur but there are plenty of others) and then link to them in a post. That's what the "Img" or Image tags are for in a php bulletin board like this.
-craig

"You can never have too many knives" -- Logan Nine Fingers
abyss
Premium Member
Premium Member
Posts: 172
Joined: Thu May 22, 2014 12:43 am

Post by abyss »

hi i pasted some screen shot, hopefully it helps. it is really simple job:
1. the whole job is get data from CFF then data go to transform stage and then go to remove duplicate stage, eventually insert into oracle table.
Image

this is the column mapping at remove duplicate stage, as you can see all the input columns map to the output
Image

for the insert statement, i only insert the customer_in into the table, and i am using datastage syntax
Image

from director, it shows the error message
Image
the error message shows below:
orc_customer,1: The input schema column NAME is not used and the connector is configured to stop when unused columns are detected in the input schema. (CC_OraRecordDataSetConsumer::setDataSetDef, file CC_OraRecordDataSetConsumer.cpp, line 3,939)


this is customer dimension design, nothing to special
create table CUSTOMER_DIM
(
customer_dim_key INTEGER not null,
customer_id INTEGER,
name VARCHAR2(50),
home_phone VARCHAR2(12),
work_phone VARCHAR2(12),
work_address VARCHAR2(50),
work_city VARCHAR2(50),
work_state VARCHAR2(50),
work_zip VARCHAR2(15),
work_country VARCHAR2(50),
home_address VARCHAR2(50),
home_city VARCHAR2(50),
home_zip VARCHAR2(15),
home_state VARCHAR2(50),
home_country VARCHAR2(50),
membership_id INTEGER,
membership_expire_dt DATE,
membership_level VARCHAR2(1),
current_ind VARCHAR2(1) default 'Y',
effective_ts TIMESTAMP(6) default CURRENT_TIMESTAMP,
expiration_ts TIMESTAMP(6) default to_timestamp ('2999-12-31 23:23:59.000','yyyy-mm-dd hh24:mi:ss.ff')
)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, read the message again carefully, then look at the INSERT statement (which fails to name the NAME column, and that's probably just the first column that it fails to name). You have configured the Connector to abort when this situation occurs.

Can you please look on the Outputs (Columns) tab of the remove_customer stage to determine whether or not Runtime Column Propagation (RCP) is enabled there?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
abyss
Premium Member
Premium Member
Posts: 172
Joined: Thu May 22, 2014 12:43 am

Post by abyss »

hi
I have checked the remove duplicate stage, the RCP is enabled as what it should be.

I think you right ray, I update the insert, change the statement to:
INSERT INTO customer_dim (CUSTOMER_ID,NAME) VALUES(ORCHESTRATE.CUSTOMER_ID,ORCHESTRATE.NAME) then the error message change to "The input schema column HOME_PHONE is not used " HOME_PHONE is the next column after NAME column, so it just keep going.

If i put all the columns in (auto generate sql statement) then the error message is:
orc_customer,0: The following SQL statement failed: INSERT INTO customer_dim (CUSTOMER_ID,NAME,MEMBERSHIP_ID,MEMBERSHIP_EXPIRE_DT,MEMBERSHIP_LEVEL,WORK_PHONE,HOME_PHONE,WORK_ADDRESS,WORK_CITY,WORK_STATE,WORK_ZIP,WORK_COUNTRY,HOME_ADDRESS,HOME_CITY,HOME_STATE,HOME_ZIP,HOME_COUNTRY) VALUES(:CUSTOMER_ID,:NAME,:MEMBERSHIP_ID,:MEMBERSHIP_EXPIRE_DT,:MEMBERSHIP_LEVEL,:WORK_PHONE,:HOME_PHONE,:WORK_ADDRESS,:WORK_CITY,:WORK_STATE,:WORK_ZIP,:WORK_COUNTRY,:HOME_ADDRESS,:HOME_CITY,:HOME_STATE,:HOME_ZIP,:HOME_COUNTRY).
orc_customer,1: The OCI function OCIStmtExecute returned status -1. Error code: 24,381, Error message: ORA-24381: error(s) in array DML. (CC_OraStatement::executeInsert, file CC_OraStatement.cpp, line 1,925)

if i set option 'fail on row option' to no, then job can be executed but no row can be insert into table. :(
abyss
Premium Member
Premium Member
Posts: 172
Joined: Thu May 22, 2014 12:43 am

Post by abyss »

I enabled/disabled RCP, dropped necessary output columns and set Drop Unmatched fields to yea and no. none of them works.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try removing all non-required columns from the output link of the Remove Duplicates stage and reverting to your original SQL statement.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
abyss
Premium Member
Premium Member
Posts: 172
Joined: Thu May 22, 2014 12:43 am

Post by abyss »

i did, this is on the remove duplicate stage:
Image

Image
abyss
Premium Member
Premium Member
Posts: 172
Joined: Thu May 22, 2014 12:43 am

Post by abyss »

and the result is exactly the same.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

and you STILL don't have NAME in your INSERT statement.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
abyss
Premium Member
Premium Member
Posts: 172
Joined: Thu May 22, 2014 12:43 am

Post by abyss »

yes, i do :s
database is down now, i will look at it later, thanks for your reply :)
abyss
Premium Member
Premium Member
Posts: 172
Joined: Thu May 22, 2014 12:43 am

Post by abyss »

hi ray
I fixed problem, i dropped all the columns except customer_id and name under the column tab from BOTH INPUT and OUTPUT link, also disable the Runtime Column Propagation as it automatically populate all the columns in remove_customer stage. then the job just worked.
i still can't run the job with all the columns, i think there are some syntax error at transformer stage
thanks
abyss
Post Reply