Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
2536303f
Commit
2536303f
authored
13 years ago
by
buczekp
Browse files
Options
Downloads
Patches
Plain Diff
[LMS-2368] minor: improved trigger exception messages
SVN: 22106
parent
300f5eea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openbis/source/sql/postgresql/migration/migration-075-076.sql
+3
-3
3 additions, 3 deletions
...bis/source/sql/postgresql/migration/migration-075-076.sql
with
3 additions
and
3 deletions
openbis/source/sql/postgresql/migration/migration-075-076.sql
+
3
−
3
View file @
2536303f
...
@@ -79,21 +79,21 @@ BEGIN
...
@@ -79,21 +79,21 @@ BEGIN
FROM
data
FROM
data
WHERE
data
.
samp_id
=
NEW
.
id
AND
data
.
del_id
IS
NULL
;
WHERE
data
.
samp_id
=
NEW
.
id
AND
data
.
del_id
IS
NULL
;
IF
(
counter
>
0
)
THEN
IF
(
counter
>
0
)
THEN
RAISE
EXCEPTION
'Sample (Code: %) deletion failed because at least one of its data sets
i
s not deleted.'
,
NEW
.
code
;
RAISE
EXCEPTION
'Sample (Code: %) deletion failed because at least one of its data sets
wa
s not deleted.'
,
NEW
.
code
;
END
IF
;
END
IF
;
-- all components need to be deleted
-- all components need to be deleted
SELECT
count
(
*
)
INTO
counter
SELECT
count
(
*
)
INTO
counter
FROM
samples
FROM
samples
WHERE
samples
.
samp_id_part_of
=
NEW
.
id
AND
samples
.
del_id
IS
NULL
;
WHERE
samples
.
samp_id_part_of
=
NEW
.
id
AND
samples
.
del_id
IS
NULL
;
IF
(
counter
>
0
)
THEN
IF
(
counter
>
0
)
THEN
RAISE
EXCEPTION
'Sample (Code: %) deletion failed because at least one of its component samples
i
s not deleted.'
,
NEW
.
code
;
RAISE
EXCEPTION
'Sample (Code: %) deletion failed because at least one of its component samples
wa
s not deleted.'
,
NEW
.
code
;
END
IF
;
END
IF
;
-- all children need to be deleted
-- all children need to be deleted
SELECT
count
(
*
)
INTO
counter
SELECT
count
(
*
)
INTO
counter
FROM
sample_relationships
sr
,
samples
sc
FROM
sample_relationships
sr
,
samples
sc
WHERE
sample_id_parent
=
NEW
.
id
AND
sc
.
id
=
sr
.
sample_id_child
AND
sc
.
del_id
IS
NULL
;
WHERE
sample_id_parent
=
NEW
.
id
AND
sc
.
id
=
sr
.
sample_id_child
AND
sc
.
del_id
IS
NULL
;
IF
(
counter
>
0
)
THEN
IF
(
counter
>
0
)
THEN
RAISE
EXCEPTION
'Sample (Code: %) deletion failed because at least one of its child samples
i
s not deleted.'
,
NEW
.
code
;
RAISE
EXCEPTION
'Sample (Code: %) deletion failed because at least one of its child samples
wa
s not deleted.'
,
NEW
.
code
;
END
IF
;
END
IF
;
RETURN
NEW
;
RETURN
NEW
;
END
;
END
;
...
...
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