Author Topic: Multiple Errors?  (Read 2338 times)

micdavhen

  • Newbie
  • *
  • Posts: 1
    • View Profile
Multiple Errors?
« on: March 23, 2009, 05:22:34 PM »
What am I doing wrong with this SQL statement?

Code: newbielink:javascript:void(0); [nonactive]
WITH
LEADTIME AS
(
select
a.iblitm as "Part Number",
a.ibltlv as "LeadTime",
to_char(to_date(substr(lpad(a.ibupmj, 6, '0'),4)|| (1900 + substr(lpad
(a.ibupmj, 6, '0'), 1, 3)),'dddyyyy'), 'mm/dd/yyyy') as "Date",
rank( )Over(Partition by a.iblitm, a.ibltlv order by a.ibupmj asc) as Rank_List
from proddta.f554102T a
where ibitm = '660722'
and ibmcu = lpad('680', 12)),

SUMMARY AS
(Select Distinct
LEADTIME."Part Number" as PartNumber,
MAX(LEADTIME."Date") AS MaxDate
FROM LEADTIME
WHERE LEADTIME.RANK_LIST = 1
group by LEADTIME."Part Number" )
SELECT
SUMMARY.PartNumber,
LEADTIME."LeadTime",
SUMMARY.MaxDate < sysdate as "NewDate"
from LEADTIME, SUMMARY
WHERE
LEADTIME."Part Number" = SUMMARY.PartNumber
AND LEADTIME."Date" = SUMMARY.MaxDate

and SUMMARY.MaxDate < to_char(to_date(sysdate, 'mm/dd/yy'))
GROUP BY
SUMMARY.PartNumber,
SUMMARY.MaxDate,
"LeadTime",
Rank_List
ORDER BY 'DATE' asc
These are the errors I am receiving...

-- ORA-00903: invalid table name
-- ORA-00900: invalid SQL statement
-- ORA-00928: missing SELECT keyword
-- ORA-00933: SQL command not properly ended

Any Suggestions?
« Last Edit: March 23, 2009, 05:53:37 PM by Mike »


Mike

  • Administrator
  • Hero Member
  • *****
  • Posts: 1947
    • View Profile
Re: Multiple Errors?
« Reply #1 on: March 23, 2009, 05:57:26 PM »
What am I doing wrong with this SQL statement?

These are the errors I am receiving...

-- ORA-00903: invalid table name
-- ORA-00900: invalid SQL statement
-- ORA-00928: missing SELECT keyword
-- ORA-00933: SQL command not properly ended

Any Suggestions?

Hmmm...well, some of the errors seem fairly self-explanatory. The "invalid table name" means you're referencing a table that doesn't appear to exist. That should be fairly easy to track down, and it may be responsible for the some or all of the other errors as well so that's where I'd start. Make sure that the tablenames you're using are all valid and that they all actually exist. I'd try to find and fix that error first.