Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6896907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:06:10+00:00 2026-05-27T07:06:10+00:00

By modify I mean counterparts of SQL UPDATE and DELETE. In both cases I

  • 0

By modify I mean counterparts of SQL UPDATE and DELETE.

In both cases I have an object-record and I would like to delete it in the database. The table has always primary key, and it is set in my object-record.

Please note that I don’t have query or other source which “created” that object-record, all I have is it and the table. So in general it looks like this:

fetch the Record from Table
...
// forget how I get the Record
...
Record.person_name = "joe"
? update Record ?

How to do it?


I define records and tables as below:

case class Topic(var id : Long,
                 var sectionId : Int,
                 ...

object TopicTable  extends Table[Topic]("Topic") {
       def id = column[Long]("top_Id", O.PrimaryKey) 
       def sectionId = column[Int]("sect_Id")
       ...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:06:10+00:00Added an answer on May 27, 2026 at 7:06 am

    It seems there are no direct methods, so you have to create explicitly a recordset in order to modify (for comparison — I know SQ is not ORM — in EF you fetch records, modify them and at this point your data context “knows” they were modify, so all you have to do is submit changes).

    So first you create RS as you like:

    val rs = for (rec <- MyTable if rec.id===10) yield rec;
    

    and the delete records:

    rs.mutate(rec => rec.delete())
    

    for update:

    rs.update(new MyRecord(...))
    

    or (gossip is, it is faster 😉 )

    rs.mutate(rec => rec.row = new MyRecord(...))
    

    Please note I am complete newbie with SQ so I might just misinformed you. I works for me though.

    Now, the only missing part is adding some nice wrappers, so delete and update could be done directly per record.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi I would like to ask how I would modify this code for the
i have a table with order details. User is able to modify these details
I would like to know how to delete a Deny rule that makes imposible
I'd like to modify the action attribute of the element to include whatever text
I want to modify something in Settings.secure database, just as the android Settings app
I have created a couple of classes mean to represent a relational data structure
I have to modify firefox to make it an automated client for testing some
I've got a node in an XSD that I'd like to modify. I'd like
I am trying to modify the System.Drawing.Printing.PrinterSettings object that I get from the System.Windows.Forms.PrintDialog
I mean not in-code access. For example I have installed app (through Testflight service)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.