Skip to Content
Menu
This question has been flagged
1 Reply
1473 Views

Hi,

SELECT name FROM product_template WHERE name='Test%';

does not work ... but I think it should.

Anyone an idea?


Thanks,

Armin

Avatar
Discard
  1. check the following steps:
  2. Check the table and column names: Ensure that the table name is correct and matches the actual table name in the database. Similarly, verify that the column name (name in this case) is accurate and matches the column name in the table.

  3. Verify the data type: Confirm that the name column is of a text-based data type (e.g., VARCHAR, TEXT). If the data type is different, the comparison in the WHERE clause may not work as expected. In such cases, you may need to adjust the query accordingly.

  4. Case sensitivity: By default, most databases are case insensitive when comparing string values. However, some databases may be case sensitive depending on the configuration. Ensure that the case of the name value you are searching for matches the case used in the table.

  5. Special characters or encoding: If the name value contains special characters or is encoded differently, it may affect the search. Make sure the encoding is consistent and that any special characters are correctly represented in the query.

  6. Use wildcard operators: If you want to search for name values starting with "Test", you can use the wildcard operator % at the end of the search term. The updated query would be:


  7. SELECT name FROM product_template WHERE name LIKE 'Test%';

If none of these solutions resolve the issue, please provide more details about the error....


Author

... thanks for your help, great.
Maybe my select-command is not correct, because the field "name" of the table product_template is of a jsonb kind.
How to proceed in such a case?

Hi, you can follow this: https://youtu.be/ntMaAYbsDYM
Hope it helps

Best Answer

Hi,

The written query is valid and working, could you provide more information about where it is not working for you.

You may not have product starting with Test, you can try opposite condition with != and see if you get some results.

Thanks

Avatar
Discard
Author

... thanks.

In both cases I receive an syntax error ....?!...
Something wrong with the odoo.sh Installation?

Related Posts Replies Views Activity
2
Mar 24
8458
2
Mar 24
5243
1
Feb 24
2520
0
Aug 21
2523
0
Aug 21
2604