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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Oracle 11g to 12C migration error

Krishna Devi VinayakaMar 26 2019 — edited Apr 4 2019

Hi,

I am trying to migrate data from oracle 11g to 12C.

We are using

Oracle Database 11g Release 11.2.0.4.0 - 64bit

Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit

My software is not working as expected in Oracle 12C.

For eg:

I have following two tables.

EMPMST

create table empmst  as  select 100 empid, 'C1001' badgeno,'Ganesh' empname from dual;

AUTHORISATIONS

create table authorisations  as

select 100 empid,'05/03/2019 16:00' fromdatetime,'05/03/2019 20:00' todatetime,'OT' authtype,'Overtime' authdescription from dual union all

select 100 empid,'05/03/2019 16:00' fromdatetime,'05/03/2019 20:00' todatetime,'DT' authtype,'Official Duty' authdescription  from dual;

I am trying to retrieve data with following query

with dat as

                    (

                              select

                                        a.empid,

                                        a.badgeno,

                                        b.fromdatetime ,

                                        b.todatetime ,

                                        b.authtype ,

                                        rownum as pkey

                              from  

                                        empmst a,

                                        authorisations b

                              where

                                        a.empid=b.empid

                         ) 


, rep as

                    (  

                         select   

                                   a.badgeno,  

                                   a.fromdatetime ,   

                                   a.todatetime ,  

                                   a.authtype, 

                                   b.fromdatetime fromdatetime1,   

                                   b.todatetime todatetime1,  

                                   b.authtype authtype1  

                         from

                                   dat a ,

                                   dat b

                          where

                                   a.pkey<>b.pkey and

                                   a.empid=b.empid and

                                   a.fromdatetime<b.todatetime and 

                                   a.todatetime>b.fromdatetime 

                    )  

select * from rep

          where  

                    (authtype='DT' and authtype1='OT') or   

                    (authtype='OT' and authtype1='DT')  

The above query gives different results in Oracle 11g and 12C.

Result in 11g (which is expected)

    

C100105/03/2019 16:0005/03/2019 20:00DT05/03/2019 16:0005/03/2019 20:00OT
C100105/03/2019 16:0005/03/2019 20:00OT05/03/2019 16:0005/03/2019 20:00DT

Result in 12C

C100105/03/2019 16:0005/03/2019 20:00DT05/03/2019 16:0005/03/2019 20:00OT

I know that it is possible to get same result in both 11g and 12C with slight modification in query. But it is not easy to check and modify  all queries used in software.

I would like to know whether i can migrate existing data to 12C without any modification in queries.

Please help

Comments
Post Details
Added on Mar 26 2019
31 comments
1,832 views