Question: I have a table named `Seller` and another table `api_tokens`.
I want to remove all rows from `api_token` table of the seller when specific column `email/password` is updated from `Seller`.
`sellerId` is the foreign\_key in `tokens` table. 
`userID` is the primary\_key in `Seller` table.

I have tried to write a trigger but i am having a syntax error by phpMyadmin.

This is the code:

```
DELIMITER //
CREATE TRIGGER my_trigger
ON Seller
AFTER UPDATE
AS BEGIN
SET NOCOUNT ON
IF UPDATE (email) 
  BEGIN
      DELETE a FROM api_tokens a
      INNER JOIN Seller s ON s.userID = a.sellerId
      Where UPDATED.userID = a.sellerId 
  END 
END

```

The trigger is not getting saved so i cannot conclude that this is working or not.

Getting syntax error by phpMyadmin but i cannot figure out what is the actual issue.

Sharing error details as well :

> 
> #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON Seller
> 
> 
>

Answer: 
You must use a terminal step, without them your query will not execute.

From tinkerpop [documentation](http://tinkerpop.apache.org/docs/3.3.3/reference/):

> 
> Typically, when a step is concatenated to a traversal a traversal is returned. In this way, a traversal is built up in a fluent, monadic fashion. However, some steps do not return a traversal, but instead, execute the traversal and return a result. These steps are known as terminal steps (terminal) and they are explained via the examples below.
> 
> 
> 

In your case, you should do:

```
g.V(event['securityEventManagerId']).values('sourceData').next()

```
Here's a snippet:

```
for p in g.V(v).properties():
   print("key:",p.label, "| value: " ,p.value)

```

where v is the vertex you want to inspect.