Sqlexception: The Case expression can only be nested into 10 layers.

Source: Internet
Author: User

From a in mm_xxzx
Where. cjrid = 1 & (. djlx = 0 |. djlx = 1 |. djlx = 5 |. djlx = 6 |. djlx = 7)
Orderby A. djlx
Select New
{
Xxlxmc = A. djlx = 0? "Repair Plan": (A. djlx = 1? "Repair task list": (A. djlx = 2? "Spare parts warehouse receiving ticket": (A. djlx = 3? "Spare parts warehouse picking ticket": "Spare Parts Plan "))),
Bm = A. bm,
MS = A. ms,
Ztmc =
(A. zt = 0 & A. djlx = 0? "New": (A. zt = 1 & A. djlx = 0? "Workshop approval": (A. zt = 2 & A. djlx = 0? "Factory approval": (A. zt = 3 & A. djlx = 0? "Complete ":
(A. zt = 0 & A. djlx = 1? "New": (A. zt = 1 & A. djlx = 1? "To be accepted": (A. zt = 2 & A. djlx = 1? "Accepted": (A. zt = 3 & A. djlx = 1? "Waiting for Repair ":
(A. zt = 0 & A. djlx = 5? "New": (A. zt = 1 & A. djlx = 5? "Custodian approval": (A. zt = 2 & A. djlx = 5? "Completed": "expired "))))))))))),

Jsrxm = A. jsrxm
}

 

the SQL stored procedure is converted to a LINQ statement. Because case when is too long, an error is returned: "sqlexception: The Case expression can only be nested into 10 layers ." No good solution yet!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.