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 9074329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:36:35+00:00 2026-06-16T18:36:35+00:00

I have just started with squeryl and have no answer for how write a

  • 0

I have just started with squeryl and have no answer for how write a query like that

SELECT ref label 
FROM x_table 
WHERE ref like x% or lable like x%

where x is some value from the user, especially I haven’t found analog of the sign % in squeryl or how can I use it.

My version:

val products = from(AppDB.productTable) (
    s => where ((s.label like value) or (s.ref like value))  select(s)
)

doesn’t work correct.

val value : Option[String] I get from the user.

  • 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-06-16T18:36:37+00:00Added an answer on June 16, 2026 at 6:36 pm

    You can try to optionize your fields, like this:

    val products = from(AppDB.productTable) (s => 
      where ((Some(s.label) like value) or (Some(s.ref) like value)) 
      select(s))
    

    That will compile as the query will be comparing an Option[String] to an Option[String]. Squeryl will handle the option state internally.

    If you are simply looking to add the wildcard to what you are comparing, assuming both sides of the like clause are of the type Option[String], then you can do this:

    s.label like value.map(_ + "%")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have just started learning linq because i like the sound of it. and
I have just started writing socket programs. Came to know that single UDP packet
I have just started learning python and am getting caught up. I come from
I have just started with phoneGap and Android. Built basic samples. I would like
I have just started with ASP.NET MVC. One thing that puzzles me is why
I have just started using jqGrid , and I have some tables that I
I have just started looking into using Modules in Flex and would like to
I have just started to write JavaScript after some time and I am confused
I have just started learning Ruby on Rails from pragmatic programmers 'Agile Web Development
we have just started using a git account of our Django website project so

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.