Can you create a table with a column that is a dictionary or a table
as its’ type? It says in QforMortals that “there is no restriction
that the column vectors must be lists of simple type”. I couldn’t
declare the column with a type (e.g. 99h$) but it did do the insert.
However, errors abound after that.
q)nos:([oid:symbol$()] acct:
symbol$(); hdr:())
q)nos insert (ABC1234;
234563485;fld1
fld2fld3!(
val;
2007.01.01;12345))
'type
q)nos insert (
ABC1234;234563485;
fld1fld2
fld3!(val; 2007.01.01;12345)) ,0 q)nos k){$[99h=@y;sublist[x;!y]!sublist[x;. y];~0\>@x;$[.Q.qp y;.Q.ind[y];y]i +!"i"$x[1]&(#y)-i:\*x;abs[x]\<#y;x#y;y]} 'type @ +
accthdr!(,
234563485;,fld1
fld2fld3!(
val;2007.01.01;12345))
,0j
q))\
q)select oid from nos
oid
ABC1234
q)select acct from nos
acct
234563485
q)select hdr from nos
k){$[99h=@y;sublist[x;!y]!sublist[x;. y];~0>@x;$[.Q.qp y;.Q.ind[y];y]i
+!“i”$x[1]&(#y)-i:*x;abs<#y;x#y;y]}
'type
@
+(,hdr)!,,
fld1fld2
fld3!(`val;2007.01.01;12345)
,0j
q))