Your a should be defined as follows:
a:(enlist`c1)!enlist($;enlist`;`c1)
You can get this using parse in your original Q-SQL update expression:
q)parse "update c1:`$c1 from t where 10h=type each c1" ! `t ,,(=;10h;(k){x'y};@:;`c1)) 0b (,`c1)!,($;,`;`c1)
Noting that , in k there is an enlist in Q
You also need to change the definition of c :
c:enlist(=;(each;type;`c1);10h);
Putting it all together:
q)t:([] c1:(`a;"dfdf";`b;"ccvcv")) q)c:enlist(=;(each;type;`c1);10h); q)b:0b; q)a:(enlist`c1)!enlist($;enlist`;`c1) q)![t;c;b;a] c1 ----- a dfdf b ccvcv
But, as pointed out in another answer, it is best to avoid a functional form where possible.
source share