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/CADGZSSeLE9EaeesTCvNZG4Uqm-3cdzUXb6JSpuFBiN7m-86wkw%40mail.gmail.com.

Reply via email to