# Creating a table using enum datatype

**URL:** <https://forum.kx.com/t/creating-a-table-using-enum-datatype/6406>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [December 4, 2009, 4:47am UTC](https://forum.kx.com/t/creating-a-table-using-enum-datatype/6406 "2009-12-04T04:47:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raghavender\_Red](https://avatars.discourse-cdn.com/v4/letter/r/67e7ee/32.png) [@Raghavender\_Red](https://forum.kx.com/u/Raghavender_Red)\
**Post date:** [December 4, 2009, 4:47am UTC](https://forum.kx.com/t/creating-a-table-using-enum-datatype/6406/1 "2009-12-04T04:47:00Z")

</div>

Hi Friends,

?

Is it possible to create a table using enum datatype?

If it is possible please give one example.

?

I am trying to create table using… **tableenum:([] enumx:`enum$())** at q prompt. But, I was getting error as **'type.?**

Please let me know?if I am wrong.

?

?

Thanks,

Raghavender.

---

<div class="post-metadata">

**Author:** ![Attila](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Attila](https://forum.kx.com/u/Attila)\
**Post date:** [December 4, 2009, 12:14pm UTC](https://forum.kx.com/t/creating-a-table-using-enum-datatype/6406/2 "2009-12-04T12:14:00Z")

</div>

you have to create the enum variable first

q)enum:`symbol$()

q)tableenum:( enumx:`enum$())&nbsp;

q)meta tableenum

c &nbsp; &nbsp;| t f a

-----| -----

enumx| s &nbsp; &nbsp;

Regards,

&nbsp;&nbsp;Attila

---

<div class="post-metadata">

**Author:** ![Raghavender\_Red](https://avatars.discourse-cdn.com/v4/letter/r/67e7ee/32.png) [@Raghavender\_Red](https://forum.kx.com/u/Raghavender_Red)\
**Post date:** [December 4, 2009, 12:22pm UTC](https://forum.kx.com/t/creating-a-table-using-enum-datatype/6406/3 "2009-12-04T12:22:00Z")

</div>

Ohh… Thank you very much… Attlia.

Now I am able to create a table using enum datatype.

But, how to insert values for that datatype.

As I was very new to kdb+, please let me know the usage of this datatype and how to insert values to this datatype.

?

?

Thanks and Regards,

Raghavender

---

<div class="post-metadata">

**Author:** ![Attila](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Attila](https://forum.kx.com/u/Attila)\
**Post date:** [December 4, 2009, 12:27pm UTC](https://forum.kx.com/t/creating-a-table-using-enum-datatype/6406/4 "2009-12-04T12:27:00Z")

</div>

https://code.kx.com/trac/wiki/QforMortals2/casting\_and\_enumerations#Enumerations

Regards,

&nbsp;&nbsp;Attila
