Case conditions not working in apex calendar and sql develover










-1















The conditions i create in case doesnt affect the apex calendar as they should this conditions are for workshifts that im creating in apex calendar.
Can someone help me it this conditions?



 create or replace PROCEDURE check_task_turnos AS
BEGIN
FOR i IN (SELECT ID, calendar_start, calendar_end, estado, TIPO,
,CASE
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 7 AND to_number(to_char(calendar_end,'HH24')) < 15
AND to_number(to_char(sysdate,'HH24')) >= 7 AND to_number(to_char(sysdate,'HH24')) >= 15
then 'apex-cal-yellow'
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 15 AND to_number(to_char(calendar_end,'HH24')) < 23
AND to_number(to_char(sysdate,'HH24')) >= 15 AND to_number(to_char(sysdate,'HH24')) >= 23
then 'apex-cal-yellow'
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 23 AND to_number(to_char(calendar_end,'HH24')) < 7
AND to_number(to_char(sysdate,'HH24')) >= 23 AND to_number(to_char(sysdate,'HH24')) >= 7
then 'apex-cal-yellow'
else null end
FROM PASSAGEM
where estado='Aceite'
and TIPO='To Do'
)

LOOP
-- registo no LOG , aqui nao registas na PASSAGEM, registas numa tabela ao lado de LOG para teres referencia de quando foi alterada a data da tarefa
INSERT INTO PASSAGEM_LOG(passagem_id,
start_date,
end_date
)
VALUES(i.id ,
i.calendar_start+( 8/24) ,
i.calendar_end +(8/24));
-- update das horas de inico e fim para posicionamento no calendario
UPDATE PASSAGEM
SET calendar_start = i.calendar_start+(8/24) --incrementamos 8horas (periodod e um turno
,calendar_end = i.calendar_end+(8/24) --incrementamos 8horas (periodod e um turno
WHERE ID = i.ID;
END LOOP;
COMMIT;
END;









share|improve this question
























  • Case conditions working or not working?

    – William Robertson
    Nov 17 '18 at 20:28











  • the case condtions they don´t work, how can i resolve this

    – uniqezorpt
    Nov 20 '18 at 12:31











  • What is “Not working”? The code won’t compile, runs with error, does nothing, does something different? How do you change an Apex calendar display anyway? I don’t see any code to change anything in your question.

    – William Robertson
    Nov 20 '18 at 12:42











  • this code what it does every time that runs adds 8 hours calendar_star and 8 hours to claendar_end and moves the blocks in apex calendar but should only do that when workshift ends like between 7 and 15 o'clock

    – uniqezorpt
    Nov 20 '18 at 12:46











  • Can you help me?

    – uniqezorpt
    Nov 20 '18 at 17:13















-1















The conditions i create in case doesnt affect the apex calendar as they should this conditions are for workshifts that im creating in apex calendar.
Can someone help me it this conditions?



 create or replace PROCEDURE check_task_turnos AS
BEGIN
FOR i IN (SELECT ID, calendar_start, calendar_end, estado, TIPO,
,CASE
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 7 AND to_number(to_char(calendar_end,'HH24')) < 15
AND to_number(to_char(sysdate,'HH24')) >= 7 AND to_number(to_char(sysdate,'HH24')) >= 15
then 'apex-cal-yellow'
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 15 AND to_number(to_char(calendar_end,'HH24')) < 23
AND to_number(to_char(sysdate,'HH24')) >= 15 AND to_number(to_char(sysdate,'HH24')) >= 23
then 'apex-cal-yellow'
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 23 AND to_number(to_char(calendar_end,'HH24')) < 7
AND to_number(to_char(sysdate,'HH24')) >= 23 AND to_number(to_char(sysdate,'HH24')) >= 7
then 'apex-cal-yellow'
else null end
FROM PASSAGEM
where estado='Aceite'
and TIPO='To Do'
)

LOOP
-- registo no LOG , aqui nao registas na PASSAGEM, registas numa tabela ao lado de LOG para teres referencia de quando foi alterada a data da tarefa
INSERT INTO PASSAGEM_LOG(passagem_id,
start_date,
end_date
)
VALUES(i.id ,
i.calendar_start+( 8/24) ,
i.calendar_end +(8/24));
-- update das horas de inico e fim para posicionamento no calendario
UPDATE PASSAGEM
SET calendar_start = i.calendar_start+(8/24) --incrementamos 8horas (periodod e um turno
,calendar_end = i.calendar_end+(8/24) --incrementamos 8horas (periodod e um turno
WHERE ID = i.ID;
END LOOP;
COMMIT;
END;









share|improve this question
























  • Case conditions working or not working?

    – William Robertson
    Nov 17 '18 at 20:28











  • the case condtions they don´t work, how can i resolve this

    – uniqezorpt
    Nov 20 '18 at 12:31











  • What is “Not working”? The code won’t compile, runs with error, does nothing, does something different? How do you change an Apex calendar display anyway? I don’t see any code to change anything in your question.

    – William Robertson
    Nov 20 '18 at 12:42











  • this code what it does every time that runs adds 8 hours calendar_star and 8 hours to claendar_end and moves the blocks in apex calendar but should only do that when workshift ends like between 7 and 15 o'clock

    – uniqezorpt
    Nov 20 '18 at 12:46











  • Can you help me?

    – uniqezorpt
    Nov 20 '18 at 17:13













-1












-1








-1








The conditions i create in case doesnt affect the apex calendar as they should this conditions are for workshifts that im creating in apex calendar.
Can someone help me it this conditions?



 create or replace PROCEDURE check_task_turnos AS
BEGIN
FOR i IN (SELECT ID, calendar_start, calendar_end, estado, TIPO,
,CASE
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 7 AND to_number(to_char(calendar_end,'HH24')) < 15
AND to_number(to_char(sysdate,'HH24')) >= 7 AND to_number(to_char(sysdate,'HH24')) >= 15
then 'apex-cal-yellow'
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 15 AND to_number(to_char(calendar_end,'HH24')) < 23
AND to_number(to_char(sysdate,'HH24')) >= 15 AND to_number(to_char(sysdate,'HH24')) >= 23
then 'apex-cal-yellow'
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 23 AND to_number(to_char(calendar_end,'HH24')) < 7
AND to_number(to_char(sysdate,'HH24')) >= 23 AND to_number(to_char(sysdate,'HH24')) >= 7
then 'apex-cal-yellow'
else null end
FROM PASSAGEM
where estado='Aceite'
and TIPO='To Do'
)

LOOP
-- registo no LOG , aqui nao registas na PASSAGEM, registas numa tabela ao lado de LOG para teres referencia de quando foi alterada a data da tarefa
INSERT INTO PASSAGEM_LOG(passagem_id,
start_date,
end_date
)
VALUES(i.id ,
i.calendar_start+( 8/24) ,
i.calendar_end +(8/24));
-- update das horas de inico e fim para posicionamento no calendario
UPDATE PASSAGEM
SET calendar_start = i.calendar_start+(8/24) --incrementamos 8horas (periodod e um turno
,calendar_end = i.calendar_end+(8/24) --incrementamos 8horas (periodod e um turno
WHERE ID = i.ID;
END LOOP;
COMMIT;
END;









share|improve this question
















The conditions i create in case doesnt affect the apex calendar as they should this conditions are for workshifts that im creating in apex calendar.
Can someone help me it this conditions?



 create or replace PROCEDURE check_task_turnos AS
BEGIN
FOR i IN (SELECT ID, calendar_start, calendar_end, estado, TIPO,
,CASE
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 7 AND to_number(to_char(calendar_end,'HH24')) < 15
AND to_number(to_char(sysdate,'HH24')) >= 7 AND to_number(to_char(sysdate,'HH24')) >= 15
then 'apex-cal-yellow'
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 15 AND to_number(to_char(calendar_end,'HH24')) < 23
AND to_number(to_char(sysdate,'HH24')) >= 15 AND to_number(to_char(sysdate,'HH24')) >= 23
then 'apex-cal-yellow'
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 23 AND to_number(to_char(calendar_end,'HH24')) < 7
AND to_number(to_char(sysdate,'HH24')) >= 23 AND to_number(to_char(sysdate,'HH24')) >= 7
then 'apex-cal-yellow'
else null end
FROM PASSAGEM
where estado='Aceite'
and TIPO='To Do'
)

LOOP
-- registo no LOG , aqui nao registas na PASSAGEM, registas numa tabela ao lado de LOG para teres referencia de quando foi alterada a data da tarefa
INSERT INTO PASSAGEM_LOG(passagem_id,
start_date,
end_date
)
VALUES(i.id ,
i.calendar_start+( 8/24) ,
i.calendar_end +(8/24));
-- update das horas de inico e fim para posicionamento no calendario
UPDATE PASSAGEM
SET calendar_start = i.calendar_start+(8/24) --incrementamos 8horas (periodod e um turno
,calendar_end = i.calendar_end+(8/24) --incrementamos 8horas (periodod e um turno
WHERE ID = i.ID;
END LOOP;
COMMIT;
END;






oracle plsql oracle-sqldeveloper oracle-apex






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '18 at 12:38









William Robertson

8,48732233




8,48732233










asked Nov 15 '18 at 16:06









uniqezorptuniqezorpt

32




32












  • Case conditions working or not working?

    – William Robertson
    Nov 17 '18 at 20:28











  • the case condtions they don´t work, how can i resolve this

    – uniqezorpt
    Nov 20 '18 at 12:31











  • What is “Not working”? The code won’t compile, runs with error, does nothing, does something different? How do you change an Apex calendar display anyway? I don’t see any code to change anything in your question.

    – William Robertson
    Nov 20 '18 at 12:42











  • this code what it does every time that runs adds 8 hours calendar_star and 8 hours to claendar_end and moves the blocks in apex calendar but should only do that when workshift ends like between 7 and 15 o'clock

    – uniqezorpt
    Nov 20 '18 at 12:46











  • Can you help me?

    – uniqezorpt
    Nov 20 '18 at 17:13

















  • Case conditions working or not working?

    – William Robertson
    Nov 17 '18 at 20:28











  • the case condtions they don´t work, how can i resolve this

    – uniqezorpt
    Nov 20 '18 at 12:31











  • What is “Not working”? The code won’t compile, runs with error, does nothing, does something different? How do you change an Apex calendar display anyway? I don’t see any code to change anything in your question.

    – William Robertson
    Nov 20 '18 at 12:42











  • this code what it does every time that runs adds 8 hours calendar_star and 8 hours to claendar_end and moves the blocks in apex calendar but should only do that when workshift ends like between 7 and 15 o'clock

    – uniqezorpt
    Nov 20 '18 at 12:46











  • Can you help me?

    – uniqezorpt
    Nov 20 '18 at 17:13
















Case conditions working or not working?

– William Robertson
Nov 17 '18 at 20:28





Case conditions working or not working?

– William Robertson
Nov 17 '18 at 20:28













the case condtions they don´t work, how can i resolve this

– uniqezorpt
Nov 20 '18 at 12:31





the case condtions they don´t work, how can i resolve this

– uniqezorpt
Nov 20 '18 at 12:31













What is “Not working”? The code won’t compile, runs with error, does nothing, does something different? How do you change an Apex calendar display anyway? I don’t see any code to change anything in your question.

– William Robertson
Nov 20 '18 at 12:42





What is “Not working”? The code won’t compile, runs with error, does nothing, does something different? How do you change an Apex calendar display anyway? I don’t see any code to change anything in your question.

– William Robertson
Nov 20 '18 at 12:42













this code what it does every time that runs adds 8 hours calendar_star and 8 hours to claendar_end and moves the blocks in apex calendar but should only do that when workshift ends like between 7 and 15 o'clock

– uniqezorpt
Nov 20 '18 at 12:46





this code what it does every time that runs adds 8 hours calendar_star and 8 hours to claendar_end and moves the blocks in apex calendar but should only do that when workshift ends like between 7 and 15 o'clock

– uniqezorpt
Nov 20 '18 at 12:46













Can you help me?

– uniqezorpt
Nov 20 '18 at 17:13





Can you help me?

– uniqezorpt
Nov 20 '18 at 17:13












1 Answer
1






active

oldest

votes


















1














You should really learn how to properly format code; the one you posted is difficult to read and understand.



As of your question: this procedure uses a cursor FOR loop. That long, ugly CASE



  • doesn't have an alias

  • is never used later in procedure code

    • if you plan to use it, set its alias (e.g. my_case) so that you could reference it as i.my_case


So, why do you expect it to do anything, anywhere? The way it is now, as if CASE was never written.






share|improve this answer























  • if i put cursor how do implement the conditions that are implement in the case

    – uniqezorpt
    Nov 19 '18 at 10:27










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',
autoActivateHeartbeat: false,
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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323442%2fcase-conditions-not-working-in-apex-calendar-and-sql-develover%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









1














You should really learn how to properly format code; the one you posted is difficult to read and understand.



As of your question: this procedure uses a cursor FOR loop. That long, ugly CASE



  • doesn't have an alias

  • is never used later in procedure code

    • if you plan to use it, set its alias (e.g. my_case) so that you could reference it as i.my_case


So, why do you expect it to do anything, anywhere? The way it is now, as if CASE was never written.






share|improve this answer























  • if i put cursor how do implement the conditions that are implement in the case

    – uniqezorpt
    Nov 19 '18 at 10:27















1














You should really learn how to properly format code; the one you posted is difficult to read and understand.



As of your question: this procedure uses a cursor FOR loop. That long, ugly CASE



  • doesn't have an alias

  • is never used later in procedure code

    • if you plan to use it, set its alias (e.g. my_case) so that you could reference it as i.my_case


So, why do you expect it to do anything, anywhere? The way it is now, as if CASE was never written.






share|improve this answer























  • if i put cursor how do implement the conditions that are implement in the case

    – uniqezorpt
    Nov 19 '18 at 10:27













1












1








1







You should really learn how to properly format code; the one you posted is difficult to read and understand.



As of your question: this procedure uses a cursor FOR loop. That long, ugly CASE



  • doesn't have an alias

  • is never used later in procedure code

    • if you plan to use it, set its alias (e.g. my_case) so that you could reference it as i.my_case


So, why do you expect it to do anything, anywhere? The way it is now, as if CASE was never written.






share|improve this answer













You should really learn how to properly format code; the one you posted is difficult to read and understand.



As of your question: this procedure uses a cursor FOR loop. That long, ugly CASE



  • doesn't have an alias

  • is never used later in procedure code

    • if you plan to use it, set its alias (e.g. my_case) so that you could reference it as i.my_case


So, why do you expect it to do anything, anywhere? The way it is now, as if CASE was never written.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 15 '18 at 20:54









LittlefootLittlefoot

24.6k71634




24.6k71634












  • if i put cursor how do implement the conditions that are implement in the case

    – uniqezorpt
    Nov 19 '18 at 10:27

















  • if i put cursor how do implement the conditions that are implement in the case

    – uniqezorpt
    Nov 19 '18 at 10:27
















if i put cursor how do implement the conditions that are implement in the case

– uniqezorpt
Nov 19 '18 at 10:27





if i put cursor how do implement the conditions that are implement in the case

– uniqezorpt
Nov 19 '18 at 10:27



















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323442%2fcase-conditions-not-working-in-apex-calendar-and-sql-develover%23new-answer', 'question_page');

);

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







這個網誌中的熱門文章

Barbados

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3