Thank Jasper, I'm starting and their tips were of great value. I need it because I will use the "instr" function that dbl has not implemented natively.
I found a library that apparently would solve my problem out, what u think of it? https://github.com/IAkumaI/doctrine-functions 2014-12-16 12:15 GMT-03:00 'Jasper N. Brouwer' via doctrine-user < [email protected]>: > > You cannot use native SQL and DQL together. > You either use native SQL queries, _or_ DQL queries. > > What is it you want to query? > Maybe we can help you with finding the correct DQL statements? > > > PS: You should also never concatenate values into your queries, but use > parameters in stead. > > So this: > > $qb->where( > $qb->expr()->like($cbus, $qb->expr()->literal('%' . $termoBusca . > '%')) > ); > > Should be this: > > $qb->where( > $qb->expr()->like($cbus, ':termoBusca') > ); > $qb->setParameter('termoBusca', '%' . $termoBusca . '%'); > > -- > Jasper N. Brouwer > (@jaspernbrouwer) > > > On 16 December 2014 at 15:45:30, Pablo ([email protected]) wrote: > > Hello everybody, > > > > how could I put a native mysql-statement in where clause using the query > > builder. > > > > example: > > > > $ sql = $ qb-> select ($ CCOD. "the cod ', $ CDES.' the DSC ') > > -> from ($ table, '') > > -> where ($ qb-> expr () -> like ($ cbus, $ qb-> expr () -..> literal > ('%' > > $ termoBusca '%'))) > > * -> 'my native string'* > > -> setMaxResults ($ limit); > > > -- > You received this message because you are subscribed to the Google Groups > "doctrine-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/doctrine-user. > For more options, visit https://groups.google.com/d/optout. > -- Pablo Vanni -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
