# INSERT / UPDATE not inserting / updating

**URL:** <https://www.five.org/t/insert-update-not-inserting-updating/218>\
**Category:** Support\
**Created:** [June 6, 2023, 7:14am UTC](https://www.five.org/t/insert-update-not-inserting-updating/218 "2023-06-06T07:14:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![toshi](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@toshi](https://www.five.org/u/toshi)\
**Post date:** [June 6, 2023, 7:14am UTC](https://www.five.org/t/insert-update-not-inserting-updating/218/1 "2023-06-06T07:14:04Z")

</div>

I have the following function:

```auto
function newnode(five, context, result) {
     return five.createError(result, JSON.stringify(five.executeQuery('INSERT INTO nodes (nodesKey, nodesUser) VALUES ("' + context.nodekeytomake + '", "' + five.currentUserKey() + '");')));
}

```

it runs and returns normally but I dont see any change in the table nodes.

i have a similar situation with an update function running but not updating.

am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![mark](https://yyz2.discourse-cdn.com/flex030/user_avatar/www.five.org/mark/32/300_2.png) [@mark](https://www.five.org/u/mark)\
**Post date:** [June 6, 2023, 10:04pm UTC](https://www.five.org/t/insert-update-not-inserting-updating/218/2 "2023-06-06T22:04:34Z")

</div>

Hi Toshi,

Where is the function being called? If it is connected to an On… event it is being executed on the client side and if it is a Do… event it is being called on the server side. You can only perform SQL on a server side function due to security restrictions so if it is being called client side it will not do anything.

As an option you could create a new function called newnodeserver which contains the SQL and then call five.executeFunction() within newnode to execute it on the back end.

Hope this helps!

Mark

---

<div class="post-metadata">

**Author:** ![toshi](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@toshi](https://www.five.org/u/toshi)\
**Post date:** [June 7, 2023, 3:57am UTC](https://www.five.org/t/insert-update-not-inserting-updating/218/3 "2023-06-07T03:57:06Z")

</div>

i get this error:

```auto
TypeError: five.executeFunction is not a function > newnodeserver.fs.js:2:30

```

---

<div class="post-metadata">

**Author:** ![mark](https://yyz2.discourse-cdn.com/flex030/user_avatar/www.five.org/mark/32/300_2.png) [@mark](https://www.five.org/u/mark)\
**Post date:** [June 7, 2023, 4:10am UTC](https://www.five.org/t/insert-update-not-inserting-updating/218/4 "2023-06-07T04:10:24Z")

</div>

Hi Toshi,

Can you send through the full code of the function and which event it is being called from?

Thanks

Mark

---

<div class="post-metadata">

**Author:** ![mark](https://yyz2.discourse-cdn.com/flex030/user_avatar/www.five.org/mark/32/300_2.png) [@mark](https://www.five.org/u/mark)\
**Post date:** [June 7, 2023, 4:18am UTC](https://www.five.org/t/insert-update-not-inserting-updating/218/5 "2023-06-07T04:18:12Z")

</div>

If you would prefer not to post the code here please send it to [support@five.co](mailto:support@five.co) and we will reply there.

Mark

---

<div class="post-metadata">

**Author:** ![toshi](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@toshi](https://www.five.org/u/toshi)\
**Post date:** [June 7, 2023, 9:20am UTC](https://www.five.org/t/insert-update-not-inserting-updating/218/6 "2023-06-07T09:20:31Z")

</div>

Thank you., i solved it by calling executeAction instead from newnodeserver and calling a custom process similar to this: [How to automate INSERT INTO](https://www.five.org/t/how-to-automate-insert-into/214)
