Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PL/SQL: ORA-00923 & ORA-06550:

2849981Jan 29 2015 — edited Jan 30 2015

Hi all,

I am getting the below error for the submited code.. please help..

declare

Spend_in_CR_Baby number (18,4);

Spend_in_CR_Child number (18,4);

Spend_in_CR_Home number (18,4);

Spend_in_CR_Man number (18,4);

Spend_in_CR_Woman number (18,4);

v_CUST_KEY number (10,0);

v_DIV_DESC varchar2(30);

begin

select CUST_KEY into v_CUST_KEY , DIV_DESC into v_DIV_DESC from match,

if  DIV_DESC = 'CR Baby' then  Spend_in_CR_Baby := sale_amt;

elsif  DIV_DESC = 'CR Child' then  Spend_in_CR_Child := sale_amt;

elsif  DIV_DESC = 'CR Home' then  Spend_in_CR_Home := sale_amt;

elsif  DIV_DESC = 'CR Man' then  Spend_in_CR_MAN := sale_amt;

elsif DIV_DESC = 'CR Woman' then  Spend_in_CR_Woman := sale_amt;

end if;

end;

Error report:
ORA-06550: line 10, column 44:
PL/SQL: ORA-00923: FROM keyword not found where expected
ORA-06550: line 10, column 1:
PL/SQL: SQL Statement ignored
ORA-06550: line 12, column 8:
PLS-00103: Encountered the symbol "DIV_DESC" when expecting one of the following:

   := . ( @ % ;
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 27 2015
Added on Jan 29 2015
1 comment
299 views