0

I just have a short question.

There's no description in the following API overview of TYPO3 how to use a "BINARY" in where() clause: https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Database/QueryBuilder/Index.html#expr

What I want to achieve? this one:

WEHRE BINARY `buyer_code` = "f#F67d";

Actually I can only do the following:

->where(
  $queryBuilder->expr()->eq('buyer_code', 'f#F67d')
);

But in this case I don't get a satisfying result for myself because I need case-sensitive here :-)

An another buyer_code exists "f#F67D" (the last char is uppercase) but I do need to look for the other one.

Thanks for helping.

user3332010
  • 147
  • 1
  • 11

2 Answers2

0

Since TYPO3 is using Doctrine API here, you could try to do

->where('BINARY `buyer_code` = ' . $queryBuilder->createNamedParameter('f#F67d'))

Please keep in mind, that this query now only works for database backends, supporting the BINARY keyword!

Euli
  • 1,143
  • 9
  • 17
0

Please have a look at Doctrine2 case-sensitive query The thread is a bit older, but seems to cover background and solution for your problem.

Julian Hofmann
  • 2,081
  • 1
  • 8
  • 16