Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1716 Zobrazení

Hi,

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

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

Anyone an idea?


Thanks,

Armin

Avatar
Zrušit
  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....


Autor

... 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

Nejlepší odpověď

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
Zrušit
Autor

... thanks.

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

Related Posts Odpovědi Zobrazení Aktivita
2
bře 24
8793
2
bře 24
5664
1
úno 24
2805
0
srp 21
2725
0
srp 21
2816