I use CS2002 + SP3 + FP1.
I use vbs script (a customized CreateSchemaObject.vbs from SDK,
this script uses OLE DB Provider for Commerce Server) to extend data
warehouse with:
1. Class MyParentClass with primary key ID.
CreateClassDef cn, "MyParentClass", "test_Source", "", True, 0, ""
CreateMemberDef cn, "MyParentClass", "ID", "NUMBER",
fGenerateColDef + fIsRequired + fPrimaryKey + fHasDefaultVal, "0", ""
2. Class MyChildClass with primary key ID.
CreateClassDef cn, "MyChildClass", "test_Source", "", True, 0, ""
CreateMemberDef cn, "MyChildClass", "ID", "NUMBER", fGenerateColDef
+ fIsRequired + fPrimaryKey + fHasDefaultVal, "0", ""
3. One-to-many relation between them.
And here I have a problem.
When creating a relation definition I must provide the name of a
parent class key, but I do not know it.
When I try to create another key, of course, I have an error
(something like "column ID is already used for another key").
How to get the name of the automatically created primary key?
P.S. Not creating primary key for MyParentClass and creating a key
manually is a solution, but I think there must be a way to use primary
key. Am I right?
--
Yours faithfully,
Alexander Yushchenko


|