Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-00911: invalid character
This was driving me to distraction and I finally determined the problem. I copied the original
from the pdf document not the html as you did. The pdf has the 'incorrect single quote marks'.
SELECT cust_last_name,
CASE credit_limit WHEN 100 THEN ’Low’ << ---- not ' ' from keyboard.
WHEN 5000 THEN ’High’
ELSE ’Medium’ END
FROM customers;
Thanks to all for the help.
Andy Hassall wrote:
> On Sun, 13 Apr 2003 21:45:08 GMT, dba <nospan_at_noway.nohow.org> wrote:
>
> >That's the exact character I used in my initial example. I don't get your point.
>
> No, it's not; you've posted two distinct queries with two types of quote,
> neither of which are the right one.
>
> Initially:
>
> >SQL> l
> > 1 SELECT cust_last_name,
> > 2 CASE credit_limit WHEN 100 THEN ’Low’
> > 3 WHEN 5000 THEN ’High’
> > 4 ELSE ’Medium’ END
> > 5* FROM customers
> >SQL> /
> >CASE credit_limit WHEN 100 THEN ’Low’
> > *
> >ERROR at line 2:
> >ORA-00911: invalid character
>
> Then:
>
> >SQL> l
> > 1 SELECT cust_last_name,
> > 2 case credit_limit when 100 then `low`
> > 3 when 5000 then `high`
> > 4 else `Medium` END
> > 5* from customers
> >SQL> /
> >case credit_limit when 100 then `low`
> > *
> >ERROR at line 2:
> >ORA-00911: invalid character
>
> The correct quote is ', as in the example in the docs.
>
> Whether you can see the difference probably depends on your font, but here
> they are together, first the two you posted then the right one:
>
> ’ ` '
>
> The first quote you've posted is apparently character code 146 according the
> editor I've just pasted it into; not 39 as for the plain single quote.
>
> The original from the docs:
>
> http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/expressions5a.htm#1033453
>
> SELECT cust_last_name,
> CASE credit_limit WHEN 100 THEN 'Low'
> WHEN 5000 THEN 'High'
> ELSE 'Medium' END
> FROM customers;
>
> --
> Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
> Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Received on Mon Apr 14 2003 - 20:00:29 CDT
![]() |
![]() |