another error i can't explain

q)met:flip ctzpsna!enlist each (TABLE_NAME;1;30;0h;0x00;0x00;178)
q)update p:22 from (update p:23 from met where t=1) where t
'type

it seems i can do a simple one:

q)update b:11 from (update b:12 from (flip ab!2 3# til 4) where b=1) where b in 0 1
a b

0 3
1 11
2 12

ta, jack

> q)met:flip ctzpsna!enlist each (TABLE_NAME;1;30;0h;0x00;0x00;178)
> q)update p:22 from (update p:23 from met where t=1) where t
> 'type

two problems

q)update p:22 from met where t
'type

fails–you can’t treat an int as a boolean that way for purposes of a
where clause

and

q)update p:23 from met where t=1
'type

fails separately–you have to match the type of the existing column
when updating with a constraint

alternatives are

q)update p:22h from (update p:23h from met where t=1) where t<>0
c t z p s n a

TABLE_NAME 1 30 22 00 00 178

q)update p:22h from (update p:23h from met where t=1) where “b”$t
c t z p s n a

TABLE_NAME 1 30 22 00 00 178

q)update p:22h from (update p:23h from met where t=1) where not not t
c t z p s n a

TABLE_NAME 1 30 22 00 00 178

etc

p needs to be type h

q)update p:22h from (update p:23h from met where t=1) where not t
c??? t z? p? s? n? a

TABLE_NAME 1 30 23 00 00 178

junan

hi aaron, junan,

thanks for your help (on both those questions).
i’m glad you’re in my timezone… roughly.?
i’m in melbourne, australia – look out for the
first grand-slam tennis event of the year which
is happening here.

now that i can see that i can reduce my problems
further to isolate my error, i hope not to bother
you too much more with trivial errors.

but it’s great that kx have this forum and the
evaluation copy of kdb+? – qudos to simon?

ta, jack.