Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OSE
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
OSE
Commits
b966ad97
Commit
b966ad97
authored
May 11, 2021
by
Laurent Lecluse
Browse files
Options
Downloads
Patches
Plain Diff
Système permettant de retourner la période correspondant à une date donnée
parent
78f2b52c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
data/ddl/package/OSE_DIVERS/body.sql
+31
-0
31 additions, 0 deletions
data/ddl/package/OSE_DIVERS/body.sql
data/ddl/package/OSE_DIVERS/definition.sql
+2
-0
2 additions, 0 deletions
data/ddl/package/OSE_DIVERS/definition.sql
with
33 additions
and
0 deletions
data/ddl/package/OSE_DIVERS/body.sql
+
31
−
0
View file @
b966ad97
...
...
@@ -119,6 +119,37 @@ CREATE OR REPLACE PACKAGE BODY "OSE_DIVERS" AS
FUNCTION
DATE_TO_PERIODE_CODE
(
date
DATE
,
annee_id
NUMERIC
)
RETURN
VARCHAR2
IS
mois
NUMERIC
;
annee
NUMERIC
;
BEGIN
mois
:
=
to_number
(
to_char
(
date
,
'mm'
));
annee
:
=
to_number
(
to_char
(
date
,
'YYYY'
));
RETURN
CASE
WHEN
annee
=
annee_id
AND
mois
=
9
THEN
'P01'
WHEN
annee
=
annee_id
AND
mois
=
10
THEN
'P02'
WHEN
annee
=
annee_id
AND
mois
=
11
THEN
'P03'
WHEN
annee
=
annee_id
AND
mois
=
12
THEN
'P04'
WHEN
annee
=
annee_id
+
1
AND
mois
=
1
THEN
'P05'
WHEN
annee
=
annee_id
+
1
AND
mois
=
2
THEN
'P06'
WHEN
annee
=
annee_id
+
1
AND
mois
=
3
THEN
'P07'
WHEN
annee
=
annee_id
+
1
AND
mois
=
4
THEN
'P08'
WHEN
annee
=
annee_id
+
1
AND
mois
=
5
THEN
'P09'
WHEN
annee
=
annee_id
+
1
AND
mois
=
6
THEN
'P10'
WHEN
annee
=
annee_id
+
1
AND
mois
=
7
THEN
'P11'
WHEN
annee
=
annee_id
+
1
AND
mois
=
8
THEN
'P12'
WHEN
annee
=
annee_id
+
1
AND
mois
=
9
THEN
'P13'
WHEN
annee
=
annee_id
+
1
AND
mois
=
10
THEN
'P14'
WHEN
annee
=
annee_id
+
1
AND
mois
=
11
THEN
'P15'
WHEN
annee
=
annee_id
+
1
AND
mois
=
12
THEN
'P16'
WHEN
annee
>
annee_id
+
1
THEN
'PTD'
ELSE
NULL
END
;
END
;
FUNCTION
GET_OSE_UTILISATEUR_ID
RETURN
NUMERIC
IS
BEGIN
IF
OSE_DIVERS
.
OSE_UTILISATEUR_ID
IS
NULL
THEN
...
...
This diff is collapsed.
Click to expand it.
data/ddl/package/OSE_DIVERS/definition.sql
+
2
−
0
View file @
b966ad97
...
...
@@ -6,6 +6,8 @@ CREATE OR REPLACE PACKAGE "OSE_DIVERS" AS
PROCEDURE
CALCULER_TABLEAUX_BORD
;
PROCEDURE
CALCUL_FEUILLE_DE_ROUTE
(
INTERVENANT_ID
NUMERIC
);
FUNCTION
DATE_TO_PERIODE_CODE
(
date
DATE
,
annee_id
NUMERIC
)
RETURN
VARCHAR2
;
FUNCTION
GET_OSE_UTILISATEUR_ID
RETURN
NUMERIC
;
FUNCTION
GET_OSE_SOURCE_ID
RETURN
NUMERIC
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment