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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:17:40+00:00 2026-05-22T22:17:40+00:00

Oracle SQL Developer complains about next SQL though I can’t seem to find the

  • 0

Oracle SQL Developer complains about next SQL though I can’t seem to find the reason:

IF to_number(to_char(sysdate, 'HH24')) > 6 THEN
  IF to_number(to_char(sysdate, 'HH24')) < 9 THEN
    SELECT 1 FROM dual;
  ELSE
    SELECT (CASE WHEN result = 'SUCCESS' THEN 1 ELSE 0 END) FROM t_job WHERE to_char(start_time, 'yyyy/mm/dd') = to_char(sysdate, 'yyyy/mm/dd');
  END IF;
ELSE
    SELECT (CASE WHEN result = 'SUCCESS' THEN 1 ELSE 0 END) FROM t_job WHERE to_char(start_time, 'yyyy/mm/dd') = to_char(sysdate, 'yyyy/mm/dd');
END IF;

What’s the mistake in provided query?

Error report:

Error starting at line 7 in command:
ELSE
Error report:
Unknown Command
(CASEWHENRESULT='SUCCESS'THEN1ELSE0END) 
--------------------------------------- 
1                                       


Error starting at line 9 in command:
END IF
Error report:
Unknown Command
  • 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-22T22:17:41+00:00Added an answer on May 22, 2026 at 10:17 pm

    There are a couple of problems with your code (which is PL/SQL, not just SQL):

    1) You are missing the begin and end around the block.

    2) Your selects need an into clause

    try:

    DECLARE
      l_result number;
    BEGIN
      IF to_number(to_char(sysdate, 'HH24')) > 6 THEN
        IF to_number(to_char(sysdate, 'HH24')) < 9 THEN
          SELECT 1 INTO l_result FROM dual;
        ELSE
          SELECT (CASE WHEN result = 'SUCCESS' THEN 1 ELSE 0 END) 
           INTO l_result 
           FROM t_job WHERE to_char(start_time, 'yyyy/mm/dd') = to_char(sysdate, 'yyyy/mm/dd');
        END IF;
      ELSE
          SELECT (CASE WHEN result = 'SUCCESS' THEN 1 ELSE 0 END) 
           INTO l_result 
           FROM t_job WHERE to_char(start_time, 'yyyy/mm/dd') = to_char(sysdate, 'yyyy/mm/dd');
      END IF;
      dbms_output.put_line('result is '||l_result);
    END;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Oracle SQL Developer, one can list the data in a table using the
I love Oracle SQL Developer so I find myself using it a lot to
I've been creating stored procedures using Oracle SQL developer. For some reason, one of
I have Oracle SQL Developer already installed and am able to connect to and
I'm trying this with Oracle SQL Developer and am on an Intel MacBook Pro.
I'm trying to connect to an oracle database with SQL Developer. I've installed the
Oracle SQL Developer allows you to update field values directly to the table without
In Oracle SQL Developer , if I'm viewing the information on a table, I
In Oracle SQL Developer, there's a SQL tab for each table. This tab contains
I'm using Oracle SQL Developer to query an Oracle DB (not sure which version

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.