on 03-26-2012 11:34 AM
Hi all,
I am trying to insert data to field - ' EQUIPMENT_COMMENT ' only in table MOC_EQUIPMENT
this is my receiver structure:
<Statement>
<MOC_EQUIPMENT>
<action> (mapped to constant- INSERT)
<table> (mapped to schema.table name)
<access>
<EQUIPMENT_COMMENT>
</access>
</MOC_EQUIPMENT>
</Statement>
Here i am trying to insert data into EQUIPMENT_COMMENT field only but i am getting error like "cannot insert NULL into MOC_EQUIPMENT.UNIT_ID "
where UNIT_ID is one more field in the table MOC_EQUIPMENT.
can anyone help to solve this error?
UNIT_ID seems to be either primary key or part of unique key or not null allowed field.
so in your receiver msg structure add UNIT_ID field, so that you can send the value of UNIT_ID field too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see the backend database table is not maintained with database constraints. Use Describe command to check the table information about primary keys and NOT NULL fields. Looks like this field does not maintain any primary keys. If so, insert the statement with necessary fields (that are not null).
Example in your case: ALways insert data with unit id. (This unit id might be sequencer too). Don't worry about key fields.
Note: If you need to query the table use that not null field unit iD and see how that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
adding to my above issue...
can i add "key "condition after access in an INSERT statement ?
<Statement>
<MOC_EQUIPMENT>
<action> (mapped to constant- INSERT)
<table> (mapped to schema.table name)
<access>
<EQUIPMENT_COMMENT>
</access>
<key>
</key>
</MOC_EQUIPMENT>
</Statement>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
for an insert statement, refer this link for the format - http://help.sap.com/saphelp_nw70/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm
the error clearly indicates that the table expects a value for the field UNIT_ID.
Check back with the target system and functional owners. You might have to populate that value also whenever you do an insert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Testing point of view tets with dummy value and see the output like data inserted in to DB or not,in your case MOC_EQUIPMENT.UNIT_ID alays expects value.
Better to get table structure from DB team and create identical name in JDBC receiver data type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.