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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:26:16+00:00 2026-06-14T15:26:16+00:00

I am trying to execute case statement but i am getting an error. Here

  • 0

I am trying to execute case statement but i am getting an error. Here is my query

select LOSA_APP.app_ref_no AS "App.Ref.No.",  CODE_BRANCH.branch_name AS "BRANCH"
from losa_app LOSA_APP
INNER JOIN
    losa_app_z LOSA_APP_Z  
ON
    losa_app.app_ref_no = losa_app_z.app_ref_no 
INNER JOIN
    code_branch CODE_BRANCH
ON
    LOSA_APP.attend_branch = CODE_BRANCH.branch_id
where 
    LOSA_APP.app_status='A' -- Application Status in {‘accepted’} 
and 
    trunc(sysdate) between (nvl(LOSA_APP_Z.li_dt, LOSA_APP_Z.li_collect_dt)) AND ((trunc(sysdate))) -- falling under the reporting period
and
    (trunc(sysdate) - nvl(losa_app_z.li_dt,losa_app_z.li_collect_dt)) > 90  -- select application cases at any step after entering Documentation flows.
and 
    losa_app.product_type = 'MG' -- Select records based on input parameter value passed in. 
and
    case :input1
        when 'ABB' Then code_branch.branch_code1 like '%0232%'
        when 'AiBB' Then code_branch.branch_code1 like '%0347%'
    end

While executing it asks me for input. After that it gives me error that

ORA-00905: missing keyword
00905. 00000 -  "missing keyword"
*Cause:    
*Action:
Error at Line: 22 Column: 50

Line 22 is when 'ABB' Then code_branch.branch_code1 like '%0232%'

What keyword i am missing?

Thanks

  • 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-14T15:26:17+00:00Added an answer on June 14, 2026 at 3:26 pm

    Don’t try to return a logical boolean from the CASE statement.

    Instead, make the CASE statement part of the logical test. Such as…

    code_branch.branch_code1
    like
    case :input1 when 'ABB'  Then '%0232%'
                 when 'AiBB' Then '%0347%' end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to execute the following query in oracle but not able to
I'm trying to execute the following code, but I'm getting SyntaxError: invalid syntax at
I am trying to write a postgres query, which is with CASE statement. The
I am trying to get some SQL to execute but am getting the following
We are trying to execute a select query which uses a column name in
I am trying to generate a digit to execute switch statement but it is
While trying to execute the following lines only the last two statements are displayed(Here
I`m trying to execute linux commant 'cat' from java code, but it does not
I know people complain usually about scripts not working, but here is a case
I'm trying to figure out how to create a dynamic case statement in a

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.