you can try to see this guide: https://my.webratio.com/learn/learningobject/getting-started-with-the-query-unit.
For example the problem could due to a wrong query definition (wrong management of schema and table name prefixes in the query) or to a syntax error (refer to the specific dbms in use). Moreover you can write a query in SQL or in HQL but these languages adopt different syntaxes. For details refer to https://my.webratio.com/learn/learningobject/how-to-use-hibernate-in-a-custom-component-v-72.
Anyway to perform operations like INSERT, UPDATE, DELETE, etc, you can refer to standard components (Create, Modify, Delete, etc) instead of Query Component. You can find related guides in the Learn section https://my.webratio.com/learn.
I hope this will help you.