This is because the standard definition of .z.pg (the handle for synchronous messages) is value. value evaluates a string using variables that are defined locally. Because the values you use in the string query aren’t defined on the process you send the query to, you’re getting an error. You can send your query as a parse tree and it will use the local definition of the variables (from the client side)
// server
q)emulation:([] a:`boolean$(); b:`boolean$(); c:`boolean$())<br>q)a:1b;b:1b;c:1b;<br>q)a<br>1b<br>q)b<br>1b<br>q)c<br>1b<br>// client<br>q)value "2+2"<br>4<br>// You get the same error if you try to use value with variables that are not defined<br>q)value "g+h"<br>'g<br> [1] g+h<br> ^<br>q)h "`emulation insert (1b;1b;1b)"
,0
q)h "emulation"
a b c
-----
1 1 1
q)h(insert;`emulation;(1b;1b;1b))<br>,1<br>q)h "emulation"<br>a b c<br>-----<br>1 1 1<br>1 1 1<br>// Note a,b,c is defined on the server<br>q)h"`emulation insert (a;b;c)"
,2
q)h"emulation"
a b c
-----
1 1 1
1 1 1
1 1 1
q)a:4
q)b:5
// a and b defined in local process (no boolean)
q)value "a+b"
9
// defining variables locally that can be send via a parse tree
q)x:1b;y:1b;z:1b
q)h(insert;`emulation;(x;y;z))
,3
q)h"emulation"
a b c
-----
1 1 1
1 1 1
1 1 1
1 1 1
You can read more about IPC here https://code.kx.com/q/basics/ipc/#send-messages