Hi,
I have to load data and functions into a specific context, not in default one.
In queries are not working as it is not able to find the nested tables in the context. Following is a demo tables and configuration.
- TestDataScript.q
;AddFun:{x+y}
;SubFun:{x-y}
;MultiFun:{AddFun[x;y]+SubFun[x;y]}
;t:( a:100?01b;b:100?01b;c:100?01b;d:100?1f)
;t1:( a:100?01b;b:100?01b;c:100?01b;d:100?1f)
;CallTable:{select from t where not a in(exec a from t1 where b=x)}
;CallTable1:{select from t where a =x}
- LoadScript.q
\d .Account1
\l Scripts\TestDataScript.q
\d .
- From the q prompt i call
\l LoadScript.q
So it creates all the above function and tables in Account1 context
Following functions work fine:
.Account1.AddFun[2;3]
.Account1.MultiFun[2;3]
.Account1.CallTable1[0b]
Except these one:
.Account1.CallTable[1b]
Error: t1
.Account1.CallTable[0b]
Error: t1
Any idea what i am doing wrong?
I changed the function CallTable by following:
;CallTable:{select from t where not a in(exec a from .Account1.t1 where b=x)}
and it works but i dont want to add name spaces in inner code.
Even i tried functional form
;CallTable3:{fact:parse “select from t where not a in(exec a from t1 where b=x)”
;?[t;raze fact 2; 0b;fact 4]}
it don’t work. Unless i add .Account1 namespace like following:
;CallTable4:{fact:parse “select from t where not a in(exec a from .Account1.t1 where b=x)”
;?[t;raze fact 2; 0b;fact 4]}