I want to update first n rows using db_update(). Is it possible?
I know we can use db_query(). something like
UPDATE <table_name> SET <field_name> = <value> LIMIT <num_rows>
I want to know whether this is possible using db_update()
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
It doesn't look like it's possible I'm afraid.
You could probably subclass
UpdateQuery and add that behaviour, but for the amount of work that would take you might be better off just using a raw SQL statement with
db_query() like you've suggested.