# How to insert into a column named 'end'

**URL:** <https://forum.inductiveautomation.com/t/how-to-insert-into-a-column-named-end/109346>\
**Category:** Ignition\
**Created:** [August 4, 2025, 7:17pm UTC](https://forum.inductiveautomation.com/t/how-to-insert-into-a-column-named-end/109346 "2025-08-04T19:17:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [August 4, 2025, 7:17pm UTC](https://forum.inductiveautomation.com/t/how-to-insert-into-a-column-named-end/109346/1 "2025-08-04T19:17:15Z")

</div>

I am doing the gold cert practice test, and part of it requires writing to a table with a column named 'end'. 'end' is a keyword in sql which leads to all sorts of issues trying to do that. So far this is what I have:

```python
insert into downtime_events
	("end")
values
	(:end)

```

However for some reason it returns this error:

```python
GatewayException: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert the value NULL into column 'line', table 'test.dbo.downtime_events'; column does not allow nulls. INSERT fails.
	caused by Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert the value NULL into column 'line', table 'test.dbo.downtime_events'; column does not allow nulls. INSERT fails.

Ignition v8.1.48 (b2025042910)
Java: Azul Systems, Inc. 17.0.14

```

It seems to be trying to insert into an entirely different column. Why would that happen? Is there a better way to insert data into a column with a keyword for a name?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [August 4, 2025, 7:20pm UTC](https://forum.inductiveautomation.com/t/how-to-insert-into-a-column-named-end/109346/2 "2025-08-04T19:20:40Z")

</div>

Use square brackets around the column name, eg.`[end]`. The square brackets `[]` are used to delimit identifiers.

Based on the error, it looks like that table has a column that does not allow null inserts, so you will need to define a value for that column when you are inserting.

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [August 4, 2025, 7:40pm UTC](https://forum.inductiveautomation.com/t/how-to-insert-into-a-column-named-end/109346/3 "2025-08-04T19:40:41Z")

</div>

Here is what I have now

```python
Insert into downtime_events
	([end])
values
	(:end)

```

And I am still getting the previous error. I do have a value, but that should not be a concern since end does allow nulls. The real concern is why is it trying to write to line, when I have only told it to write to end?

---

<div class="post-metadata">

**Author:** ![ryan.perretta](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.perretta/32/75110_2.png) [@ryan.perretta](https://forum.inductiveautomation.com/u/ryan.perretta)\
**Post date:** [August 4, 2025, 7:42pm UTC](https://forum.inductiveautomation.com/t/how-to-insert-into-a-column-named-end/109346/4 "2025-08-04T19:42:15Z")

</div>

`INSERT INTO`....

will attempt to insert a row.

Assuming you want to update an existing row's `end` column with a timestamp. You should be using `UPDATE` instead

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [August 4, 2025, 7:44pm UTC](https://forum.inductiveautomation.com/t/how-to-insert-into-a-column-named-end/109346/5 "2025-08-04T19:44:12Z")

</div>

INSERT inserts a entire row, so if a value is not defined for a column in the table being inserted to, a default value (most commonly NULL) will be inserted for that column.

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [August 4, 2025, 7:48pm UTC](https://forum.inductiveautomation.com/t/how-to-insert-into-a-column-named-end/109346/6 "2025-08-04T19:48:08Z")

</div>

Maybe try backticks (`) instead of brackets. That's what I always use when running into keywords as column names. I wasn't aware of brackets as an alternative.

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [August 4, 2025, 7:52pm UTC](https://forum.inductiveautomation.com/t/how-to-insert-into-a-column-named-end/109346/7 "2025-08-04T19:52:00Z")

</div>

Thanks, that was the problem

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 4, 2025, 11:54pm UTC](https://forum.inductiveautomation.com/t/how-to-insert-into-a-column-named-end/109346/8 "2025-08-04T23:54:39Z")

</div>

> [@Ryan\_Deardorff](#):
>
> Maybe try backticks (`) instead of brackets.

Those are MySQL and MariaDB identifier quotes. Square brackets are Microsoft identifier quotes. Double quotes are SQL **standard** identifier quotes, and are the only quotes allowed in Oracle and Postgres.

Most DB brands with non-standard quotes will accept standard quotes, but sometimes only with a setting change ("ANSI" mode in MS).

Single ordinary quote characters are **value** quotes in the standard. Some DB brands with non-standard identifier quotes accept double quotes as value quotes. (Oy!)

If you care about standards, use double quotes for SQL identifiers.
