Hi guys,
working my way through through Q for Mortals, and have a question on http://code.kx.com/q4m3/8_Tables/#851-definition-of-foreign-key.
Followed along and setup a foreign key from tdetails
pointing to kt
then following the tutorial:
When you wish to resolve a foreign key i.e., get the actual values instead of enumerated values apply value
to the enumerated column.
q)meta update value eid from tdetailsc | t f a---| -----eid| j sc | j
Observe that there is no longer an entry in the f
column.
What is the use of the above command?
Even without doing meta update value eid from tdetails
I I can query tdetails
using dot notation, e.g.: select eid.name, sc from tdetails and automatically get name
merged in from the kt
-table. This seems to be the same as after doing the above command.
I’ve read that enums and their underlying values are not the same (which makes perfect sense), but they behave the same in almost any context. So what’s the use of explicitly translating enums to values using the above? Moreover, when changing anything about the enums (adding an enum for example) would I need to rerun this command?
Thanks,
Geert