# Function restrictions

**URL:** <https://forum.kx.com/t/function-restrictions/9581>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [March 6, 2015, 5:53am UTC](https://forum.kx.com/t/function-restrictions/9581 "2015-03-06T05:53:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![borota](https://avatars.discourse-cdn.com/v4/letter/b/f17d59/32.png) [@borota](https://forum.kx.com/u/borota)\
**Post date:** [March 6, 2015, 5:53am UTC](https://forum.kx.com/t/function-restrictions/9581/1 "2015-03-06T05:53:00Z")

</div>

If I run this in a script it works.

&nbsp;dwaction: ([action:`dload`kload`kinc]desc:(“D”;“K”;“KI”));

&nbsp;`:db/dwaction set dwaction;

&nbsp;dwstatus: ([status:`progress`success`error]desc:(“P”;“F”;“E”));

&nbsp;`:db/dwstatus set dwstatus;

&nbsp;dwlog: (action:`dwaction$();status:`dwstatus$();start:`datetime$();end:`datetime$();err:();note:());

&nbsp;`:db/dwlog set dwlog;

---

<div class="post-metadata">

**Author:** ![charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@charlie1](https://forum.kx.com/u/charlie1)\
**Post date:** [March 6, 2015, 9:31am UTC](https://forum.kx.com/t/function-restrictions/9581/2 "2015-03-06T09:31:00Z")

</div>

the error arises from missing globals. The foreign key symbol (closely related to enums) needs to be a global. You can reproduce the error condensed into

q)f:{a:`a`b`c;`a$`a`b`c}

q)f

{a:`a`b`c;`a$`a`b`c}

'type

$

`a

`a`b`c

q)f:{`a set `a`b`c;`a$`a`b`c}

q)f

`a$`a`b`c
