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!

Getting "Invalid Relational Operator" Message

user12296489Dec 3 2009 — edited Dec 3 2009
Per PLSQL Code..

I am trying to run the below query and keep getting an invalid relational operator message. Upon clicking OK, the cursor blinks right in front of the equal sign on the following highlighted line:

and (grp00.grp00_rerate_month = 2
or TO_DATE(TO_CHAR(grp00.grp00_stat_eff_date),'MM')) = '2')

Here is the whole code the above is a part of, it is in the last of the criteria clauses..I figure it has something to do with my parenthesis? Also is the code below it correct? I was trying to get the month criteria to be February (month 2). I think the TO_DATE function requires a string date, so I tried to convert using the TO_CHAR. Then I figured the result would be a string result, so I put it in quotes. Is that correct?

Thanks for any help..

SELECT me607.subscriber_id,
me607.person_id,
me607.elig_start_date,
me607.elig_end_date,
me607.mbr_type,
me607.last_name,
me607.first_name,
me607.address_1,
me607.address_2,
me607.city,
me607.state,
me607.zip,
me607.zip_4,
me607.county_name,
me607.member_ssn,
grp00.grp00_org_suid,
grp00.grp00_grp_id,
grp00.grp00_name,
grp00.grp00_rerate_month,
grp00.grp00_stat_eff_date,
grp00.grp00_stat_code,
grp15.grp15_rmc_desc product,
grp06.grp06_cov_code,
MAX(DECODE(grp07_benefit_plan_type,'MEDICAL ',grp07_benefit_plan)) AS pc_med,
MAX(DECODE(grp07_benefit_plan_type,'DRUG ',grp07_benefit_plan)) AS pc_drg
from 607_mbr_exp me607,
grp00_master grp00,
grp15_grp_codes grp15,
grp06_grp_cov grp06,
grp07_cov_ben grp07
where me607.group_id = grp00.grp00_grp_id
and me607.rmc_code = grp15.grp15_rmc
and grp00.grp00_grp_id = grp06.grp06_grp_id
and grp07.grp07_cov_code = grp06.grp06_cov_code
and grp00.grp00_rmc_2 in ('M','MP','MS','MX')
and grp06.grp06_cov_eff_date < sysdate
and grp06.grp06_cov_exp_date > sysdate
and me607.elig_start_date < sysdate
and me607.elig_end_date > sysdate
and (grp00.grp00_stat_code = 'A'
or grp00.grp00_stat_code = 'C'
and grp00.grp00_stat_eff_date > sysdate)
and (grp00.grp00_rerate_month = 2
or TO_DATE(TO_CHAR(grp00.grp00_stat_eff_date),'MM')) = '2')
group by
me607.subscriber_id,
me607.person_id,
me607.elig_start_date,
me607.elig_end_date,
me607.mbr_type,
me607.last_name,
me607.first_name,
me607.address_1,
me607.address_2,
me607.city,
me607.state,
me607.zip,
me607.zip_4,
me607.county_name,
me607.member_ssn,
grp00.grp00_org_suid,
grp00.grp00_grp_id,
grp00.grp00_name,
grp00.grp00_rerate_month,
grp00.grp00_stat_eff_date,
grp00.grp00_stat_code,
grp15.grp15_rmc_desc,
grp06.grp06_cov_code;
This post has been answered by 730428 on Dec 3 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 31 2009
Added on Dec 3 2009
5 comments
766 views