3

我有一个全局索引(XWES.ETI),我想用它来拉取花药表的下标。XWES.ETI 全局有一个下标(一个序列号),并且有两条数据我想用作缓存 sql 存储映射 (^ZIDETRP) 中定义的实际全局的下标。我的类编译没有错误,但不会加载并在 %AcquireLock 中出现错误,因为我创建的一个变量(edt)未定义。我知道这段代码很接近,但我似乎无法发现问题。建议任何人?课程如下:

Class System.ErrTest Extends (%Persistent, %XML.Adaptor) [ StorageStrategy = Legacy ] 
{

Property ErrID As %Library.Integer;

Property ErrDt As %Library.Date;

Property ErrNum As %Library.Integer;

Property EDat As %Library.String;

///  Index iMaster on ErrID [IDKey,Unique]; 
Index iMaster On ErrID [ IdKey, Unique ];

<Storage name="Legacy"> 
  <ExtentSize>100000</ExtentSize> 
  <IdLocation>^XWES.ETI</IdLocation> 
  <SequenceNumber>6</SequenceNumber> 
<SQLMap name="Map1"> 
  <Data name="EDat"> 
   <Delimiter>$c(0)</Delimiter> 
   <Node>1</Node> 
   <Piece>1</Piece> 
  </Data> 
  <Data name="ErrDt"> 
   <RetrievalCode> Set {*}=edt</RetrievalCode> 
  </Data> 
  <Data name="ErrNum"> 
   <RetrievalCode> Set {*}=enum</RetrievalCode> 
   </Data> 
 <Global>^ZIDETRAP</Global> 
 <RowReference>^ZIDETRAP(edt,enum)</RowReference> 
 <Subscript name="1"> 
   <AccessType>Other</AccessType> 
   <Accessvar name="1"> 
     <Code> S edt=$p(^XWES.ETI({L1}),"^",1)</Code> 
     <Variable>edt</Variable> 
   </Accessvar> 
   <Accessvar name="2"> 
     <Code> S enum=$p(^XWES.ETI({L1}),"^",2)</Code> 
     <Variable>enum</Variable> 
   </Accessvar> 
   <Expression>{ErrID}</Expression> 
   <NextCode> s {L1}=$Order(^XWES.ETI({L1}))</NextCode> 
 </Subscript> 
<Type>data</Type> 
</SQLMap> 
<StreamLocation>^WSandlin.System.ErrTestS</StreamLocation> 
<Type>%CacheSQLStorage</Type> 
</Storage> 
}
4

1 回答 1

1

我没有用数据尝试过这个,但是 %AquireLock 问题消失了,因为它是一个只读映射。这是一种 hack,但它可能会起作用或有帮助,而且评论时间太长了。

{

Property ErrID As %Library.Integer;

Property ErrDt As %Library.Date;

Property ErrNum As %Library.Integer;

Property EDat As %Library.String;

///  Index iMaster on ErrID [IDKey,Unique]; 
Index iMaster On (ErrID, ErrDt, ErrNum) [ IdKey, Unique ];

<Storage name="Legacy">
<ExtentSize>100000</ExtentSize>
<IdLocation>^XWES.ETI</IdLocation>
<SequenceNumber>6</SequenceNumber>
<SQLMap name="Map1">
<Data name="EDat">
<Delimiter>$c(0)</Delimiter>
<Node>1</Node>
<Piece>1</Piece>
</Data>
<Global>^ZIDETRAP</Global>
<RowIdSpec name="1">
<Expression>{ErrID}</Expression>
<Field>ErrID</Field>
</RowIdSpec>
<RowIdSpec name="2">
<Expression>$P(^XWES.ETI({ErrID}),"^",1)</Expression>
<Field>ErrDt</Field>
</RowIdSpec>
<RowIdSpec name="3">
<Expression>$P(^XWES.ETI({ErrID}),"^",2)</Expression>
<Field>ErrNum</Field>
</RowIdSpec>
<Subscript name="1">
<Expression>{ErrID}</Expression>
<NextCode>s {L1}=$Order(^XWES.ETI({L1}))</NextCode>
</Subscript>
<Subscript name="2">
<AccessType>Other</AccessType>
<DataAccess>$p(^XWES.ETI({L1}),"^",1)</DataAccess>
<Expression>{ErrDt}</Expression>
<NextCode>S {L2}=""</NextCode>
<StopExpression>1</StopExpression>
</Subscript>
<Subscript name="3">
<AccessType>Other</AccessType>
<DataAccess>$p(^XWES.ETI({L1}),"^",1)</DataAccess>
<Expression>{ErrNum}</Expression>
<NextCode>S {L3}=""</NextCode>
<StopExpression>1</StopExpression>
</Subscript>
<Type>data</Type>
</SQLMap>
<StreamLocation>^WSandlin.System.ErrTestS</StreamLocation>
<Type>%CacheSQLStorage</Type>
</Storage>
}
于 2012-11-29T19:48:26.890 回答