cancel
Showing results for 
Search instead for 
Did you mean: 

JAVA API: problem with DeleteRecords with Binary Table

former_member207329
Participant
0 Kudos

I have a problem with delete blob object from Binary Table.

I use following code:

try {

//<b>id</b> is my ID recorbd. Ex: "1"

//and <b>repData</b> is my CataloData object

A2iIntArray ids = new A2iIntArray();

ids.Add(Integer.parseInt(id));

CMTableInfo tableMDM = repData.GetTable(TABLE_BINARY_OBJECT);

String[] fieldsMDM = getTableFieldCodeNames(repData,tableMDM.GetCode());

ResultSetDefinition rsd = new ResultSetDefinition(TABLE_BINARY_OBJECT);

for (int nr=0;nr<fieldsMDM.length;nr++){

rsd.AddField(fieldsMDM[nr]);

}

A2iResultSet rs = repData.GetRecordsById(rsd,ids);

A2iIntArray pos = rs.GetIDs();

A2iIntArray changeStamps=rs.GetChangeStamps();

repData.DeleteRecords(TABLE_BINARY_OBJECT,pos,changeStamps);

} catch (Exception e) {

System.out.println("error="+e.getMessage());

}

but return alwasy this error:<b>error=DeleteRecords error </b>

Why?

Someone can help me?

Best regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You cannot delete blob object if <b>there is a reference to this blob object from some other table.</b>

If ImageA is linked to the Item123, then you cannot delete this ImageA from the Images table unless to remove the links.

In Data Manager, for an image you can see where all this image is refered to, using the <b>Usage Tab of Select Single/Multiple Images selection dialog</b>

This may be the reason for the error when you use the API to delete Images

Hope this helps,

Please mark helpful answers.

former_member207329
Participant
0 Kudos

I have resolved the problem with your help.

Thanks a lot.

Best regards

Answers (0)