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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:53:13+00:00 2026-05-30T02:53:13+00:00

I’m having a little trouble with this sql view. CREATE OR REPLACE VIEW view_themed_booking

  • 0

I’m having a little trouble with this sql view.

CREATE OR REPLACE VIEW view_themed_booking AS 
SELECT tb.*,         
       CASE 
         WHEN (tb.themed_party_size % 2) = 0 THEN 
           (tb.themed_party_size-2)/2
         ELSE ((tb.themed_party_size-2)/2) + 0.5
       END themed_tables
  FROM themed_booking tb;

Can anyone help me here? I’m trying to add a column to the end of the view that the natural number result of (S-2)/2 where S is the themed_party_size.

When i say natural number result i mean like round up the answers that end in .5 so if S=7 the answer would be 3 and not 2.5.

The error I get when I try and run the above code is

Error starting at line 1 in command:
CREATE OR REPLACE VIEW view_themed_booking AS 
SELECT tb.*,         
  CASE WHEN (tb.themed_party_size % 2) = 0
    THEN (tb.themed_party_size-2)/2
    ELSE ((tb.themed_party_size-2)/2) + 0.5
  END themed_tables
FROM themed_booking tb
Error at Command Line:3 Column:34
Error report:
SQL Error: ORA-00911: invalid character
00911. 00000 -  "invalid character"
*Cause:    identifiers may not start with any ASCII character other than
           letters and numbers.  $#_ are also allowed after the first
           character.  Identifiers enclosed by doublequotes may contain
           any character other than a doublequote.  Alternative quotes
           (q'#...#') cannot use spaces, tabs, or carriage returns as
           delimiters.  For all other contexts, consult the SQL Language
           Reference Manual.
*Action:

If it makes a difference I am using sqldeveloper connected to an oracle server so I can use PL/SQL.

  • 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-30T02:53:14+00:00Added an answer on May 30, 2026 at 2:53 am

    I think you can simplify with the CEIL() or ROUND() function:

    CREATE OR REPLACE VIEW view_themed_booking AS 
    SELECT tb.*,         
           ROUND((tb.themed_party_size-2)/2) AS themed_tables
      FROM themed_booking tb;
    

    Not sure why you get that error. Perhaps it’s the % operator that is not available in Oracle. This links suggests so: Fundamentals of PL/SQL. There seems to be a MOD() function though.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Does anyone know how can I replace this 2 symbol below from the string
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
We're building an app, our first using Rails 3, and we're having to build

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.