Skip to Main Content
  • Questions
  • ORA-00923: FROM keyword not found where expected

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, Tom.

Asked: April 28, 2017 - 9:29 pm UTC

Last updated: May 02, 2017 - 2:52 am UTC

Version: Peoplesoft HCM

Viewed 10K+ times! This question is

You Asked

(SQR 5528) ORACLE OCIStmtExecute error 923 in cursor 16:
ORA-00923: FROM keyword not found where expected
SQL: SELECT DISTINCT B10.EMPLID from PS_BEN_PROG_PARTIC a10, PS_EMPLOYEES
b10, PS_BEN_DEFN_PGM d10 where a10.EMPLID = b10.EMPLID AND
a10.BENEFIT_PROGRAM = d10.BENEFIT_PROGRAM AND a10.EFFDT = (select
MAX(a10.EFFDT) from PS_BEN_PROG_PARTIC b10 where a10.EMPLID =
b10.EMPLID) AND b10.FULL_PART_TIME = 'P' AND d10.BENEFIT_PROGRAM in
('PT1','PT2','PT3','PT4','PT5') UNION SELECT DISTINCT A101.EMPLID DO
WRITE-RETIREMENT-FOR-PART-TIME from PS_BEN_PROG_PARTIC a101,
PS_EMPLOYEES b101, PS_BEN_DEFN_PGM d101 where a101.EMPLID = b101.EMPLID
and a101.BENEFIT_PROGRAM = d101.BENEFIT_PROGRAM and a101.EFFDT = (select
MAX(a101.EFFDT) from PS_BEN_PROG_PARTIC d101 where a101.EMPLID =
b101.EMPLID) AND B101.FULL_PART_TIME ='P' and d101.BENEFIT_PROGRAM in
('PT1', 'PT2', 'PT3', 'PT4', 'PT5') UNION select distinct a102.emplid DO
WRITE-RETIREMENT-FOR-PART-TIME from PS_BEN_PROG_PARTIC a102,
PS_EMPLOYEES b102, PS_BEN_DEFN_PGM d102 where a102.EMPLID = b102.EMPLID
and a102.BENEFIT_PROGRAM = d102.BENEFIT_PROGRAM and a102.EFFDT = (select
MAX(d102.EFFDT) from PS_BEN_PROG_PARTIC d102 where a102.EMPLID =
b102.EMPLID) AND a102.FULL_PART_TIME ='P' and d102.BENEFIT_PROGRAM
='RPT' Union select distinct a103.EMPLID from PS_EMPLOYEES a103 where
a103.FULL_PART_TIME = 'F' Union select distinct a104.emplid from
PS_EMPLOYEES a104 where a104.FULL_PART_TIME = 'F'


and Connor said...

I'm *guessing* your question is "why" ? Who knows...you just cut-pasted a sql statement :-)

But yes....even on my database where I dont have Peoplesoft...its a basic syntax error

SQL> SELECT DISTINCT B10.EMPLID from PS_BEN_PROG_PARTIC a10, PS_EMPLOYEES
  2  b10, PS_BEN_DEFN_PGM d10 where a10.EMPLID = b10.EMPLID AND
  3  a10.BENEFIT_PROGRAM = d10.BENEFIT_PROGRAM AND a10.EFFDT = (select
  4  MAX(a10.EFFDT) from PS_BEN_PROG_PARTIC b10 where a10.EMPLID =
  5  b10.EMPLID) AND b10.FULL_PART_TIME = 'P' AND d10.BENEFIT_PROGRAM in
  6  ('PT1','PT2','PT3','PT4','PT5') UNION SELECT DISTINCT A101.EMPLID DO
  7  WRITE-RETIREMENT-FOR-PART-TIME from PS_BEN_PROG_PARTIC a101,
  8  PS_EMPLOYEES b101, PS_BEN_DEFN_PGM d101 where a101.EMPLID = b101.EMPLID
  9  and a101.BENEFIT_PROGRAM = d101.BENEFIT_PROGRAM and a101.EFFDT = (select
 10  MAX(a101.EFFDT) from PS_BEN_PROG_PARTIC d101 where a101.EMPLID =
 11  b101.EMPLID) AND B101.FULL_PART_TIME ='P' and d101.BENEFIT_PROGRAM in
 12  ('PT1', 'PT2', 'PT3', 'PT4', 'PT5') UNION select distinct a102.emplid DO
 13  WRITE-RETIREMENT-FOR-PART-TIME from PS_BEN_PROG_PARTIC a102,
 14  PS_EMPLOYEES b102, PS_BEN_DEFN_PGM d102 where a102.EMPLID = b102.EMPLID
 15  and a102.BENEFIT_PROGRAM = d102.BENEFIT_PROGRAM and a102.EFFDT = (select
 16  MAX(d102.EFFDT) from PS_BEN_PROG_PARTIC d102 where a102.EMPLID =
 17  b102.EMPLID) AND a102.FULL_PART_TIME ='P' and d102.BENEFIT_PROGRAM
 18  ='RPT' Union select distinct a103.EMPLID from PS_EMPLOYEES a103 where
 19  a103.FULL_PART_TIME = 'F' Union select distinct a104.emplid from
 20  PS_EMPLOYEES a104 where a104.FULL_PART_TIME = 'F' ;
WRITE-RETIREMENT-FOR-PART-TIME from PS_BEN_PROG_PARTIC a101,
*
ERROR at line 7:
ORA-00923: FROM keyword not found where expected


And you can see on line 7 the why ... "DO followed by WRITE..."

Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

A reader, April 29, 2017 - 1:06 pm UTC


Connor McDonald
May 01, 2017 - 7:10 am UTC

LMAO !!!

You gave us an SQL with no question, no ddl, no schema, nothing....

...and we still managed to tell you what was wrong.

And you weren't happy

Obviously

Duke Ganote, May 01, 2017 - 3:30 pm UTC

The Oracle Masters just can't "DO WRITE" -- or is it "DO RIGHT"? -- by some people! :)
Connor McDonald
May 02, 2017 - 2:52 am UTC

:-)