Database Administration (MOSC)

MOSC Banner

FBIs with Date columns and case option

edited Apr 3, 2015 10:01AM in Database Administration (MOSC) 5 commentsAnswered

Hi

Based on this link https://jonathanlewis.wordpress.com/category/oracle/indexing/function-based-indexes/ 

And trying to understand the requirement of one of my developer Could we have a FBI with case options for Dates nulls and Date not nutll?

Could we create a FBIs with Date columns and case options

create table t1 

    col1    int not null,

    col2    varchar2(1)

); 

create unique index t1_i1 on t1(

--  case col2 when null then cast(null as int) else col1 end,

--  case when col2 is null then cast(null as int) else col1 end,

    case when col2 is not null then col1 end,

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center