laravel-firebird icon indicating copy to clipboard operation
laravel-firebird copied to clipboard

% wildcard counting in column length

Open gssj85 opened this issue 1 year ago • 2 comments

I'm using Laravel 9 and I have a query that does a where like to a column varchar(14).

When the like has the full length of the column I get a error saying it expected 14 and got 16 characters.

Example: where document like '%12345678901234%'

When I do the same query in the console it works, but when the Laravel does it doesn't.

Is this behavior normal? I'm kinda new to Firebird...

Giving a bit more context:

Screenshot from 2023-06-08 17-40-05 Screenshot from 2023-06-08 17-39-47 Screenshot from 2023-06-08 17-40-24

gssj85 avatar Jun 08 '23 01:06 gssj85

Using PDO it works:

Screenshot from 2023-06-09 08-59-06

Screenshot from 2023-06-09 09-00-14

gssj85 avatar Jun 09 '23 12:06 gssj85

Update:

Using whereRaw worked.

Will keep using it for now but curious as to why it doesn't work with where, maybe something when the params are bind?

I tried looking at the code but I'm not skilled enough yet for this task.

gssj85 avatar Jun 09 '23 14:06 gssj85