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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:45:28+00:00 2026-05-20T03:45:28+00:00

I already sent the bug to fsbugs@microsoft.com but I also added this link to

  • 0

I already sent the bug to fsbugs@microsoft.com but I also added this link to letter for additional description, code highlighting, discussions and maybe someone find some way to avoid it, because I really like it and want to use.

Code :

<@ seq {for a in db.ArchiveAnalogs do
            for d in db.Deltas do
                if a.ID = d.ID then
                    if a.Value > d.DeltaLimit then
                        yield a.Date, d.AboveMessage
                    else if a.Value < d.DeltaLimit then
                        yield a.Date, d.BelowMessage}
     @> |> query |> Array.ofSeq

Same error messages with update :

   <@ seq {for a in db.ArchiveAnalogs do
                        for d in db.Deltas do
                            if a.ID = d.ID && a.Value > d.DeltaLimit then
                                yield a.Date, d.AboveMessage
                            elif a.ID = d.ID && a.Value < d.DeltaLimit then
                                yield a.Date, d.BelowMessage}
                 @> |> query |> Array.ofSeq

Error message :

The following construct was used in query but is not recognised by the

F#-to-LINQ query translator: Call
(None,
System.Collections.Generic.IEnumerable1[System.Tuple2[System.DateTime,System.String]]
Singleton[Tuple2](System.Tuple2[System.DateTime,System.String]),
[NewTuple (PropertyGet (Some (a), System.DateTime Date, []),
PropertyGet (Some (d), System.String AboveMessage,
[]))]) This is not a valid query
expression. Check the specification of
permitted queries and consider moving
some of the query out of the quotation

Fixed

Code :

    let px =
        query <| 
        <@ seq { for cl in db.Dictionaries -> cl }
                    |> Seq.filter(fun x -> x.ID_Line = l1 || x.ID_Line = l2) @>
        |> fun pquery ->
            query <|
            <@ seq { for cd in db.DeltaCompares do
                        for cl1 in pquery do
                                            if cd.IID1 = cl1.IID then
                                                for cl2 in pquery do
                                                    if cd.IID2 = cl2.IID then
                                                        yield cl1
                                                        yield cl2 } @>
            |> List.ofSeq

Same error with update :

            let p =
                [for cl in db.Dictionaries -> cl]
                |> Seq.filter(fun x -> x.ID_Line = l1 || x.ID_Line = l2)
                |> fun pquery ->
                    <@ seq { for cd in db.DeltaCompares do
                                for cl1 in pquery do
                                    for cl2 in pquery do
                                    if cd.IID1 = cl1.IID && cd.IID2 = cl2.IID then
                                        yield cl1, cl2 } @>
                    |> query |> Seq.collect(fun a -> [fst a; snd a])

Error message :

The following construct was used in query but is not
recognised by the F#-to-LINQ query
translator: Call (None,
System.Collections.Generic.IEnumerable`1[LinqBase.Dictionary]
SingletonDictionary,
[cl1]) This is not a valid query expression. Check the specification of
permitted queries and consider moving
some of the query out of the quotation

fixed

I’m not sure if I do it correct so I also ask you to confirm if this is a bug or not a bug

  • 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-20T03:45:29+00:00Added an answer on May 20, 2026 at 3:45 am

    In the first case, I think the F#-to-LINQ translator may be failing on nested if. Have you tried: (…)

    EDIT [Second attempt]: It could also fail because we’re using if without else clause. What if you always return something using option type and then filter out None values (there may be a way to make it nicer, but let’s start with this):

    <@ seq {for a in db.ArchiveAnalogs do
                for d in db.Deltas do
                  yield
                    if a.ID = d.ID && a.Value > d.DeltaLimit then
                      Some(a.Date, d.AboveMessage)
                    elif a.ID = d.ID a.Value < d.DeltaLimit then 
                      Some(a.Date, d.BelowMessage)
                    else None }
         @> |> query |> Seq.choose id |> Array.ofSeq
    

    In the second case, it may be failing because of the for nested in if. I’d try this (…)

    EDIT: This is actually incorrect use of LINQ (and it wouldn’t work in C# too). The problem is that you’re collecting some data in memory (pquery) and then passing this as an input to the LINQ (so that it would have to send the data back to the SQL server.

    You can try writing it like this (BTW: I think using |> fun x -> is a weird construct when you can write the same thing simply just using let):

    let pquery = <@ db.Dictionaries
                |> Seq.filter(fun x -> x.ID_Line = l1 || x.ID_Line = l2) @>
    let px = 
      <@ seq { for cd in db.DeltaCompares do
                 for p in %pquery do ... } |> query
    

    This is using quotation splicing. For more information about this feature, see my article (search for splicing).

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

Sidebar

Related Questions

I get this: Warning: session_start(): Cannot send session cookie - headers already sent by
Possible Duplicate: php headers already sent error I have attached my code which am
Possible Duplicates: PHP headers already sent PHP session_start() error? What does this error mean?
Possible Duplicate: PHP headers already sent So I just joined Hostgator.com, and was wondering,
I have this problem with Headers already sent with Magento. I get this error:
first: My technical problem is already solved, so this is not urgent, but I
Warning (2): Cannot modify header information - headers already sent by (output started at
If you have a large class that executes after output(headers/text) is already sent, will
A buddy sent me a later version of an .apk file. I already had
Already finished implementing the player. I want to implement the progress bar. But I

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.