0
我可以這樣做:InterSystems的緩存DB - 特定ROWSPEC動態
Query All() As %Query(CONTAINID = 1, ROWSPEC = "Title:%String,Author:%String")
{
}
但我需要動態指定ROWSPEC。我有像這樣的全局變量:
^glob("title1","author1","xxKZ1") = "val1"
^glob("title1","author1","ssn","xyPO2") = "val2"
^glob("title2","author2","xxII8") = "val3"
^globNext("key1") = "val1"
^globNext("key1","key2") = "val2"
所以我需要動態創建查詢行的結構。對於^水珠,我需要有這樣的事情:
Query All() As %Query(CONTAINID = 1, ROWSPEC = "Prop1:%String, Prop2:%String, Prop3:%String, Prop4:%String, Val:%String")
{
}
對於^ globNext我需要這樣的東西:
Query All() As %Query(CONTAINID = 1, ROWSPEC = "Prop1:%String, Prop2:%String)
{
}
是否有可能去實現它?
你的意思是我會有1000道具(cols),並且只會使用前5個例子?最後的列將是空的? – mrfazolka
是的,在你的代碼中,'Fetch'代碼只是作爲結果添加到Row = $ lb(「val1」,「val2」)中,或者甚至是'Row = $ lb(「name:val1 「,」name:val2「)' – DAiMor
好吧,我會考慮它,並可能嘗試它。謝謝 – mrfazolka