Slick update

52 views
Skip to first unread message

prasad mokkapati

unread,
Dec 9, 2016, 4:18:23 PM12/9/16
to Slick / ScalaQuery
Hi

Is there a way to update a table column based on a query from another table instead of using plain sql - sqlu
Essentially I want to be able to something like below without using plain sql.

sqlu"""UPDATE program set program_status_id = (select id 

       FROM program_status WHERE status_name=$status) 

       AND id = $program_id""".first



Thanks

Dave Nicponski

unread,
Dec 9, 2016, 4:45:56 PM12/9/16
to scala...@googlegroups.com
Nope, not currently.


```
Updates are performed by writing a query that selects the data to update and then replacing it with new data. The query must only return raw columns (no computed values) selected from a single table.
```

--

---
You received this message because you are subscribed to the Google Groups "Slick / ScalaQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalaquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalaquery/c16efa1e-9bcc-4894-9e16-64b059829faf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages