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!

using regexp_instr in a where clause - invalid relational operator

oaksongOct 23 2013 — edited Oct 24 2013

Whey I try to run this query in TOAD I get an ORA-00920: invalid relational operator error. It's part of a 10g stored procedure. When I highlight it and run it it prompts me for the missing values and then the error pops up. The AND in line 4 is highlighted.

select CRIME_CLASSIFICATION_ID, crime_type, nvl(count(CRIME_CLASSIFICATION_ID),0) as CRIMECNT

From vaps.vw_offenses

    where  regexp_instr(valoc,to_char(location_id))

        AND ( fromdate is null or

         offense_date between to_date(fromdate, 'mm/dd/yyyy')  AND to_date(todate,'mm/dd/yyyy')

         )

group by crime_classification_id, crime_type

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2013
Added on Oct 23 2013
4 comments
709 views