Cheers

On Saturday, November 5, 2022 at 1:44:58 PM UTC-4 Jeremy Evans wrote:

> On Sat, Nov 5, 2022 at 5:52 AM [email protected] <[email protected]> wrote:
>
>> How can I delete records whose field values are greater than a certain 
>> length?
>>
>> DL[:archives].where(:quotation.length > 300).delete
>>
>> I've also tried:
>>
>> DL[:archives].where(Sequel[:quotation.length] > 300).delete
>>
>
> You need to call a database function to determine the length.  Thankfully, 
> Sequel supports this case already:
>
>   DL[:archives].where(Sequel.char_length(:quotation) > 300).delete
>
> This will call the appropriate database function for the database you are 
> using.
>
> Thanks,
> Jeremy
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/75fbd0e1-d9cf-484a-9e9d-b39581de447cn%40googlegroups.com.

Reply via email to