Getting Invalid character while executing the query(error code 00911)

Hi Experts,

The below query is getting 00911 ERROR INVALID CHARACTER
What will be the wrong in the below query

                         FROM curr_ref curr_ref
                         WHERE curr_ref.ml_curcurrcode = dv_curr_ref.curcurrcode
                           AND curr_ref.ml_curlanguage = NVL ('en', 'en')),
                         dv_curr_ref.curcurrmajor) AS currencyname,dv_curr_ref.curcurrcode AS currid
   FROM dv_curr_ref dv_curr_ref where dv_curr_ref.DELETEFLAG='N';

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
Syntax looks good to me but I cannot run it since I don't have your tables.
My guess is you are getting that error when running the SQL inside some other product.  If so, remove the ending ';' and try again.

That said:  Why are you creating a table alias that is the same as the table name?

... FROM curr_ref curr_ref ...

It isn't incorrect but isn't necessary.

This doesn't do anything:  NVL ('en', 'en')

I also don't like the inline select.  I'm thinking a simple join should work.
srikoteshAuthor Commented:

I Have removed ; at the end of the query still facing the issue
removed alias names
this input i gave it as  -->AND curr_ref.ml_curlanguage = 'en'

still no results
slightwv (䄆 Netminder) Commented:
>>still no results

No results or still getting the invalid character error?

Can you explain how you are executing that query? Can you use sqlplus or SQL Developer?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

srikoteshAuthor Commented:
I am using sql developer
still getting the same error invalid character
slightwv (䄆 Netminder) Commented:
Verify what you are running is what you posted.  Make sure the single quotes are actually single quotes and not smart quotes.

I dummied up some tables and it runs for me:
SQL> create table curr_ref(ml_curcurrmajor char(1), ml_curcurrcode char(1), ml_curlanguage char(1));

Table created.

SQL> create table dv_curr_ref( curcurrcode char(1), curcurrmajor char(1), DELETEFLAG char(1));

Table created.

  2                           FROM curr_ref
  3                           WHERE curr_ref.ml_curcurrcode = dv_curr_ref.curcurrcode
  4                             AND curr_ref.ml_curlanguage = 'en' ),
  5                           dv_curr_ref.curcurrmajor) AS currencyname,dv_curr_ref.curcurrcode AS currid
  6     FROM dv_curr_ref where dv_curr_ref.DELETEFLAG='N';

no rows selected

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
srikoteshAuthor Commented:
now i am able to execute the query.
looks like space issue.
srikoteshAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.