# How to set a default value to a non-nullable column in Database query component- advanced mode select query

**URL:** <https://matillioncommunity.discourse.group/t/how-to-set-a-default-value-to-a-non-nullable-column-in-database-query-component-advanced-mode-select-query/1508>\
**Category:** Matillion ETL\
**Created:** [October 12, 2021, 1:53pm UTC](https://matillioncommunity.discourse.group/t/how-to-set-a-default-value-to-a-non-nullable-column-in-database-query-component-advanced-mode-select-query/1508 "2021-10-12T13:53:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![VVeda](https://sea2.discourse-cdn.com/flex002/user_avatar/matillioncommunity.discourse.group/vveda/32/834_2.png) [@VVeda](https://matillioncommunity.discourse.group/u/VVeda)\
**Post date:** [October 12, 2021, 1:53pm UTC](https://matillioncommunity.discourse.group/t/how-to-set-a-default-value-to-a-non-nullable-column-in-database-query-component-advanced-mode-select-query/1508/1 "2021-10-12T13:53:47Z")

</div>

I'm using a database query component and I'd like to mark a few columns which are non-nullable as say N/A or NA ( a default value) in my target table in Snowflake. What should my query look like?

---

<div class="post-metadata">

**Author:** ![Bryan](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@Bryan](https://matillioncommunity.discourse.group/u/Bryan)\
**Post date:** [October 13, 2021, 4:52pm UTC](https://matillioncommunity.discourse.group/t/how-to-set-a-default-value-to-a-non-nullable-column-in-database-query-component-advanced-mode-select-query/1508/2 "2021-10-13T16:52:06Z")

</div>

Hi [@VVeda](https://matillioncommunity.discourse.group/u/VVeda)​,

I might be missing something here but it sounds like you have 1 or more non-nullable columns in the target Snowflake table and for 1 or more of those columns you want to supply something like "N/A" as the value. This should be straightforward by specifying the value in the SELECT statement. As SQL example could be:

SELECT some\_col1 as col1, some\_col2 as col2, **'N/A' as col3**

FROM your\_source\_table

The idea is that you are always returning N/A for every row returned by the source table for that particular column. I hope I understood your question this helps.

Thanks,

Bryan

---

<div class="post-metadata">

**Author:** ![VVeda](https://sea2.discourse-cdn.com/flex002/user_avatar/matillioncommunity.discourse.group/vveda/32/834_2.png) [@VVeda](https://matillioncommunity.discourse.group/u/VVeda)\
**Post date:** [October 13, 2021, 5:54pm UTC](https://matillioncommunity.discourse.group/t/how-to-set-a-default-value-to-a-non-nullable-column-in-database-query-component-advanced-mode-select-query/1508/3 "2021-10-13T17:54:30Z")

</div>

Thanks Bryan, yes, that is what I did and it did work. I was overthinking and was trying to use a Calculator component. But, as you said, I included the "NA" in my select query and it worked. Thanks for taking the time. It took a few attempts for me to figure out this solution, but glad it worked. Thanks for your response anyways, truly appreciate it.
