Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #40 from raffaelloferrari/master
Browse files Browse the repository at this point in the history
PSU parsing problem #93
  • Loading branch information
amreo authored Oct 30, 2019
2 parents a7fc73f + 44413af commit b7a56f2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sql/psu-2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ SELECT DBMS_DB_VERSION.VERSION || '.' || DBMS_DB_VERSION.RELEASE into :VERSION F
(
select
case
WHEN substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1) = '1' THEN TO_DATE('140114','YYMMDD')
WHEN substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1) = '2' THEN TO_DATE('150120','YYMMDD')
WHEN substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1) = '3' THEN TO_DATE('150414','YYMMDD')
WHEN substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1) = '4' THEN TO_DATE('150714','YYMMDD')
WHEN substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1) = '5' THEN TO_DATE('151020','YYMMDD')
WHEN length(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1)) = 6 THEN TO_DATE(substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,7),'YYMMDD')
WHEN substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,1) = '1' THEN TO_DATE('140114','YYMMDD')
WHEN substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,1) = '2' THEN TO_DATE('150120','YYMMDD')
WHEN substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,1) = '3' THEN TO_DATE('150414','YYMMDD')
WHEN substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,1) = '4' THEN TO_DATE('150714','YYMMDD')
WHEN substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,1) = '5' THEN TO_DATE('151020','YYMMDD')
ELSE
TO_DATE(substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,7),'YYMMDD')
END as PSU_DATE
Expand Down

0 comments on commit b7a56f2

Please sign in to comment.