Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on ORA-00920 Invalid Relational Operator

Status
Not open for further replies.

TinaH

Technical User
Jul 1, 2008
1
US
I am getting an ORA-00920 error on the following script referencing the first WHERE line. The operator is = so I know that is a good one. I cannot see where else I am in error, so need some assistance please.

SELECT O100191.ACCOUNT_NAME
, O100191.CUST_ACCOUNT_ID
, O100191.STATUS
, 0100191.TAX_CODE
, O100206.PARTY_NAME
, O100206.CUSTOMER_KEY
, O100206.TAX_NAME
, O100206.TAX_REFERENCE

FROM AR.HZ_PARTIES O100206
, AR.HZ_CUST_ACCOUNTS O100191

WHERE 0100206.STATUS = 0100191.STATUS
AND 0100206.PARTY_NAME = "WHATEVER PARTY";

Thank you!!
 
Tina,

Oracle recognizes only single quotes (') as the beginning and ending delimiter for literal character strings in SQL...Oracle uses double quotes (") in its flavor of SQL to enclose expression aliases and to surround Oracle object names.

Therefore, you must change this code:
Code:
...AND 0100206.PARTY_NAME = "WHATEVER PARTY";
...to this code:
Code:
AND 0100206.PARTY_NAME = 'WHATEVER PARTY';
Let us know if this resolves your problem.



[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
“Beware of those that seek to protect you from harm or risk. The cost will be your freedoms and your liberty.”
 
You shouldn't be using double quotes, but that's not the cause of your ORA-00920 error. You appear to be mistyping the table names in the where clause to begin with a zero instead of the character "O". Please try

Code:
SELECT O100191.ACCOUNT_NAME
, O100191.CUST_ACCOUNT_ID
, O100191.STATUS
, 0100191.TAX_CODE
, O100206.PARTY_NAME
, O100206.CUSTOMER_KEY
, O100206.TAX_NAME
, O100206.TAX_REFERENCE

FROM AR.HZ_PARTIES O100206
, AR.HZ_CUST_ACCOUNTS O100191

WHERE O100206.STATUS = O100191.STATUS
AND O100206.PARTY_NAME = 'WHATEVER PARTY';
 
Correction: There is also a similar error in one of the columns in your select clause.

Code:
SELECT O100191.ACCOUNT_NAME
, O100191.CUST_ACCOUNT_ID
, O100191.STATUS
, O100191.TAX_CODE
, O100206.PARTY_NAME
, O100206.CUSTOMER_KEY
, O100206.TAX_NAME
, O100206.TAX_REFERENCE

FROM AR.HZ_PARTIES O100206
, AR.HZ_CUST_ACCOUNTS O100191

WHERE O100206.STATUS = O100191.STATUS
AND O100206.PARTY_NAME = 'WHATEVER PARTY';
 
Tina,

What were your findings following our suggestions?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
“Beware of those that seek to protect you from harm or risk. The cost will be your freedoms and your liberty.”
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top