Home » SQL & PL/SQL » SQL & PL/SQL » ORA-00942: table or view does not exist (Oracle 10g, Toad 9.1)
ORA-00942: table or view does not exist [message #335009] Sat, 19 July 2008 06:04 Go to next message
yogeshyl
Messages: 50
Registered: October 2007
Location: Silvassa
Member
I am getting the error -'Query cannot be parsed, please check the syntax of your query. (ORA-00942: table or view does not exist) ' when trying to run it in Oracle Application Express.

How can i optimize or correct the error..


SELECT DISTINCT BH_NO,
BH_DT,
BH_TXN_CODE TXN_CODE,
FORM_DESC,
SUPP_NAME SUPPLIER_NAME,
ITEM_NAME,
TO_NUMBER(BI_QTY
||'.'
||BI_QTY_LS) QTY,
GH_NO GRN_NO,
GH_DT GRN_DT,
BH_SUPP_REF INVH_NO,
BH_SUPP_REF_DT INVH_DT,
BI_RATE RATE,
BI_FC_VAL ITEM_AMNT,
SUM(CASE
WHEN ITED_TED_CODE IN ('AED',
'BED',
'EDU CESS',
'SHECESS',
'AED1',
'BED1',
'EDU CESS1',
'SHECESS1',
'DTA',
'DTA E CESS',
'DTA S CESS') THEN ITED_NET_LC_AMT
ELSE 0
END) EXCISE,
SUM(CASE
WHEN ITED_TED_CODE IN ('CST 12.5%',
'CST 2%',
'CST 3%',
'CST 4%',
'VAT 12.5%',
'VAT 4%') THEN ITED_NET_LC_AMT
ELSE 0
END) TAX,
SUM(CASE
WHEN ITED_TED_CODE IN ('SERV 12%',
'SR ED CES 2%',
'SR HS CES 1%') THEN ITED_NET_LC_AMT
ELSE 0
END) SERVICE_TAX,
SUM(CASE
WHEN ITED_TED_CODE IN ('P-FREIGHT',
'P-INS',
'PURDISC',
'R-OFF',
'SHORT',
'DIFFERENCE') THEN ITED_LC_AMT
ELSE 0
END) OTHER
FROM OM_SUPPLIER,
OM_ITEM,
OT_BILL_HEAD,
OT_BILL_ITEM,
OT_BILL_ITEM_TED,
OT_GR_HEAD,
OM_FORM
WHERE BI_BH_SYS_ID = BH_SYS_ID
AND SUPP_CODE = BH_SUPP_CODE
AND ITEM_CODE = BI_ITEM_CODE
AND FORM_CODE = BH_FORM_CODE
AND BH_SYS_ID = ITED_H_SYS_ID
AND BI_SYS_ID = ITED_I_SYS_ID
AND BH_REF_SYS_ID = GH_SYS_ID
GROUP BY BH_NO,
BH_DT,
BH_TXN_CODE,
SUPP_NAME,
ITEM_NAME,
BI_QTY,
BI_QTY_LS,
GH_NO,
GH_DT,
BH_SUPP_REF,
BH_SUPP_REF_DT,
BI_RATE,
BI_FC_VAL,
FORM_DESC
ORDER BY BH_DT ASC
Re: ORA-00942: table or view does not exist [message #335017 is a reply to message #335009] Sat, 19 July 2008 07:50 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Yopu have posted often enough to know how to format your code. Please do so according to the forum guidelines
Re: ORA-00942: table or view does not exist [message #335020 is a reply to message #335009] Sat, 19 July 2008 09:51 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Database Error Messages

Regards
Michel
Re: ORA-00942: table or view does not exist [message #335032 is a reply to message #335009] Sat, 19 July 2008 12:15 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
That sounds easy; if it says "table or view doesn't exist" and, at the same time, FROM clause contains
Quote:
OM_SUPPLIER,
OM_ITEM,
OT_BILL_HEAD,
OT_BILL_ITEM,
OT_BILL_ITEM_TED,
OT_GR_HEAD,
OM_FORM
it seems that one (or more) of these tables (or views) doesn't exist in this user's schema, or is not accessible in some other way (as a public synonym, etc.).

After all, error message is quite self-explaining, isn't it?
Re: ORA-00942: table or view does not exist [message #335033 is a reply to message #335032] Sat, 19 July 2008 13:07 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
After all, error message is quite self-explaining, isn't it?

So why do you need to explain it? Laughing

Regards
Michel
Previous Topic: How to see the structure of view on command line
Next Topic: Execute Immediate / Forall
Goto Forum:
  


Current Time: Sun Dec 04 08:38:37 CST 2016

Total time taken to generate the page: 0.27280 seconds