The symbol “* was inserted before ”=" to continue
up vote
-1
down vote
favorite
create or replace trigger check_status BEFORE update on LDS_PLACEMENT
for each row declare STATUS LDS_PLACEMENT.STATUS%type;
begin
STATUS :=old.STATUS;
if STATUS := 'Closed' then
raise_application_error(-20111,'Sorry the placement is closed');
end if;
end;
I get error at line 5. The code is not compiling.
This is for an academic assignment.
oracle database-trigger
add a comment |
up vote
-1
down vote
favorite
create or replace trigger check_status BEFORE update on LDS_PLACEMENT
for each row declare STATUS LDS_PLACEMENT.STATUS%type;
begin
STATUS :=old.STATUS;
if STATUS := 'Closed' then
raise_application_error(-20111,'Sorry the placement is closed');
end if;
end;
I get error at line 5. The code is not compiling.
This is for an academic assignment.
oracle database-trigger
1
What is the error (message)?
– Lithilion
Nov 19 at 8:26
You need a collation asSTATUS = 'Closed'
, but not an assignment. That's the reason for the error. Just remove:
inSTATUS := 'Closed'
– Barbaros Özhan
Nov 19 at 8:32
Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions.
– halfer
Nov 19 at 19:07
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
create or replace trigger check_status BEFORE update on LDS_PLACEMENT
for each row declare STATUS LDS_PLACEMENT.STATUS%type;
begin
STATUS :=old.STATUS;
if STATUS := 'Closed' then
raise_application_error(-20111,'Sorry the placement is closed');
end if;
end;
I get error at line 5. The code is not compiling.
This is for an academic assignment.
oracle database-trigger
create or replace trigger check_status BEFORE update on LDS_PLACEMENT
for each row declare STATUS LDS_PLACEMENT.STATUS%type;
begin
STATUS :=old.STATUS;
if STATUS := 'Closed' then
raise_application_error(-20111,'Sorry the placement is closed');
end if;
end;
I get error at line 5. The code is not compiling.
This is for an academic assignment.
oracle database-trigger
oracle database-trigger
edited Nov 19 at 19:07
halfer
14.3k758107
14.3k758107
asked Nov 19 at 8:24
Suyesh Bhatta
1
1
1
What is the error (message)?
– Lithilion
Nov 19 at 8:26
You need a collation asSTATUS = 'Closed'
, but not an assignment. That's the reason for the error. Just remove:
inSTATUS := 'Closed'
– Barbaros Özhan
Nov 19 at 8:32
Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions.
– halfer
Nov 19 at 19:07
add a comment |
1
What is the error (message)?
– Lithilion
Nov 19 at 8:26
You need a collation asSTATUS = 'Closed'
, but not an assignment. That's the reason for the error. Just remove:
inSTATUS := 'Closed'
– Barbaros Özhan
Nov 19 at 8:32
Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions.
– halfer
Nov 19 at 19:07
1
1
What is the error (message)?
– Lithilion
Nov 19 at 8:26
What is the error (message)?
– Lithilion
Nov 19 at 8:26
You need a collation as
STATUS = 'Closed'
, but not an assignment. That's the reason for the error. Just remove :
in STATUS := 'Closed'
– Barbaros Özhan
Nov 19 at 8:32
You need a collation as
STATUS = 'Closed'
, but not an assignment. That's the reason for the error. Just remove :
in STATUS := 'Closed'
– Barbaros Özhan
Nov 19 at 8:32
Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions.
– halfer
Nov 19 at 19:07
Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions.
– halfer
Nov 19 at 19:07
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
Remove :
from the equal in the if statement
:= means your assigning value like you did above in the old.status
create or replace trigger check_status BEFORE update on LDS_PLACEMENT
for each row declare STATUS LDS_PLACEMENT.STATUS%type;
begin
STATUS := :old.STATUS;
if STATUS = 'Closed' then
raise_application_error(-20111,'Sorry the placement is closed');
end if;
end;
identifier 'OLD.STATUS' must be declaredCompilation failed, line 3 (14:14:31) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers
– Suyesh Bhatta
Nov 19 at 8:29
i get this error when i remove the colon
– Suyesh Bhatta
Nov 19 at 8:30
@SuyeshBhatta ok check now, added:
in:old.status
– Moudiz
Nov 19 at 8:32
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53370775%2fthe-symbol-was-inserted-before-to-continue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Remove :
from the equal in the if statement
:= means your assigning value like you did above in the old.status
create or replace trigger check_status BEFORE update on LDS_PLACEMENT
for each row declare STATUS LDS_PLACEMENT.STATUS%type;
begin
STATUS := :old.STATUS;
if STATUS = 'Closed' then
raise_application_error(-20111,'Sorry the placement is closed');
end if;
end;
identifier 'OLD.STATUS' must be declaredCompilation failed, line 3 (14:14:31) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers
– Suyesh Bhatta
Nov 19 at 8:29
i get this error when i remove the colon
– Suyesh Bhatta
Nov 19 at 8:30
@SuyeshBhatta ok check now, added:
in:old.status
– Moudiz
Nov 19 at 8:32
add a comment |
up vote
1
down vote
Remove :
from the equal in the if statement
:= means your assigning value like you did above in the old.status
create or replace trigger check_status BEFORE update on LDS_PLACEMENT
for each row declare STATUS LDS_PLACEMENT.STATUS%type;
begin
STATUS := :old.STATUS;
if STATUS = 'Closed' then
raise_application_error(-20111,'Sorry the placement is closed');
end if;
end;
identifier 'OLD.STATUS' must be declaredCompilation failed, line 3 (14:14:31) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers
– Suyesh Bhatta
Nov 19 at 8:29
i get this error when i remove the colon
– Suyesh Bhatta
Nov 19 at 8:30
@SuyeshBhatta ok check now, added:
in:old.status
– Moudiz
Nov 19 at 8:32
add a comment |
up vote
1
down vote
up vote
1
down vote
Remove :
from the equal in the if statement
:= means your assigning value like you did above in the old.status
create or replace trigger check_status BEFORE update on LDS_PLACEMENT
for each row declare STATUS LDS_PLACEMENT.STATUS%type;
begin
STATUS := :old.STATUS;
if STATUS = 'Closed' then
raise_application_error(-20111,'Sorry the placement is closed');
end if;
end;
Remove :
from the equal in the if statement
:= means your assigning value like you did above in the old.status
create or replace trigger check_status BEFORE update on LDS_PLACEMENT
for each row declare STATUS LDS_PLACEMENT.STATUS%type;
begin
STATUS := :old.STATUS;
if STATUS = 'Closed' then
raise_application_error(-20111,'Sorry the placement is closed');
end if;
end;
edited Nov 19 at 8:32
answered Nov 19 at 8:25
Moudiz
3,950949107
3,950949107
identifier 'OLD.STATUS' must be declaredCompilation failed, line 3 (14:14:31) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers
– Suyesh Bhatta
Nov 19 at 8:29
i get this error when i remove the colon
– Suyesh Bhatta
Nov 19 at 8:30
@SuyeshBhatta ok check now, added:
in:old.status
– Moudiz
Nov 19 at 8:32
add a comment |
identifier 'OLD.STATUS' must be declaredCompilation failed, line 3 (14:14:31) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers
– Suyesh Bhatta
Nov 19 at 8:29
i get this error when i remove the colon
– Suyesh Bhatta
Nov 19 at 8:30
@SuyeshBhatta ok check now, added:
in:old.status
– Moudiz
Nov 19 at 8:32
identifier 'OLD.STATUS' must be declaredCompilation failed, line 3 (14:14:31) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers
– Suyesh Bhatta
Nov 19 at 8:29
identifier 'OLD.STATUS' must be declaredCompilation failed, line 3 (14:14:31) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers
– Suyesh Bhatta
Nov 19 at 8:29
i get this error when i remove the colon
– Suyesh Bhatta
Nov 19 at 8:30
i get this error when i remove the colon
– Suyesh Bhatta
Nov 19 at 8:30
@SuyeshBhatta ok check now, added
:
in :old.status
– Moudiz
Nov 19 at 8:32
@SuyeshBhatta ok check now, added
:
in :old.status
– Moudiz
Nov 19 at 8:32
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53370775%2fthe-symbol-was-inserted-before-to-continue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
What is the error (message)?
– Lithilion
Nov 19 at 8:26
You need a collation as
STATUS = 'Closed'
, but not an assignment. That's the reason for the error. Just remove:
inSTATUS := 'Closed'
– Barbaros Özhan
Nov 19 at 8:32
Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions.
– halfer
Nov 19 at 19:07