创建Relation并Add到数据库

比如说,创建一个AssmStrc(Bom关系)的Relation,设置一些属性,然后添加到数据库去:
ObjectPtr assmObj = NULL;
ObjectPtr assmMstrObj = NULL;
ObjectPtr asmstrcRel = NULL;
string dbName = NULL;
 
//...
dstat = ConstructRelation(AssmStrcClass, assmObj, assmMstrObj, mfail, &asmstrcRel);
 
objSetAttribute(asmstrcRel, AttribueName, AttributeValue);
//...
dstat = BeginDbFrame(AssmStrcClass, &dbName, mfail);
dstat = InsertDbRelation(newRelObj, assmObj, assmMstrObj, mfail);
dstat = EndDbFrame(AssmStrcClass, dbName, mfail);
//...

你可能感兴趣的:(数据库)