# error in your SQL using dbt\_utils.union\_relations (\_dbt\_source\_relation)

**URL:** https://discourse.getdbt.com/t/error-in-your-sql-using-dbt-utils-union-relations-dbt-source-relation/13369
**Category:** In-Depth Discussions
**Tags:** dbt-core
**Created:** [May 15, 2024, 9:28am UTC](https://discourse.getdbt.com/t/error-in-your-sql-using-dbt-utils-union-relations-dbt-source-relation/13369 "2024-05-15T09:28:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sthienard](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@sthienard](https://discourse.getdbt.com/u/sthienard)
#### Post date: [May 15, 2024, 9:28am UTC](https://discourse.getdbt.com/t/error-in-your-sql-using-dbt-utils-union-relations-dbt-source-relation/13369/1 "2024-05-15T09:28:47Z")

</div>

Hi,

I get an SQL error using dbt\_utils.union\_relations :

1064 (42000): 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 'TEXT) as \_dbt\_source\_relation,

Model code is :

{{ dbt\_utils.union\_relations(  
relations=[  
ref(‘view\_1’),  
ref(‘view\_2’),  
ref(‘view\_3’)  
]  
) }}

Each model view\_1.sql, view\_2.sql, view\_3.sql works good separatly

Using following syntax with my SQL client works good :

SELECT \* FROM view\_1  
UNION ALL  
SELECT \* FROM view\_2  
UNION ALL  
SELECT \* FROM view\_3

Thank you for your help
