GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV Mobile 2024
→
Problem with HFSQL scheduled task
Problem with HFSQL scheduled task
Iniciado por Thomas Soegiarto, abr., 17 2021 9:04 AM - 3 respostas
Conecte-se…
Thomas Soegiarto
#1
Membro registado
3 mensagems
Publicado em abril, 17 2021 - 9:04 AM
Hi.. I'm trying to create a scheduled task to send a notification every 10 minutes in the HFSQL control center. The stored procedure is tested and functional. Also, no errors occurred the test. But when I run this scheduled task on HFSQL it can't even send a single notification. Is there anyone who can help me?
IF
NOT
HFileExist
(
sm_paramedic
)
THEN
IF
NOT
HDeclareExternal
(
".\sm_paramedic.fic"
,
"paramedic"
)
THEN
RESULT
HErrorInfo
(
)
END
END
HDeclareExternal
(
".\sm_paramedic.fic"
,
"paramedic"
)
IF
ErrorOccurred
=
True
THEN
RESULT
(
HErrorInfo
(
)
)
END
IF
NOT
HFileExist
(
NotificationDoctor
)
THEN
IF
NOT
HDeclareExternal
(
".\NotificationDoctor.FIC"
,
"NotifDoctor"
)
THEN
RESULT
HErrorInfo
(
)
END
END
HDeclareExternal
(
".\NotificationDoctor.FIC"
,
"NotifDoctor"
)
IF
ErrorOccurred
=
True
THEN
// Error while declaring the file, display the error
RESULT
(
HErrorInfo
(
)
)
END
HReadSeek
(
sm_paramedic
,
sm_paramedicID
,
178
)
ExpDate
is string
=
DateToString
(
sm_paramedic.sm_paramedicSTRExpDate
,
"DD/MM/YYYY"
)
NotificationDoctor.sm_paramedicID
=
sm_paramedic.sm_paramedicID
NotificationDoctor.Subject
=
"STR Expiry in 1 months"
NotificationDoctor.Description
=
"STR Expiration on "
+
ExpDate
+
". This notification just to warn you to renew your license!"
NotificationDoctor.DateCreated
=
Today
(
)
NotificationDoctor.TimeCreated
=
Now
(
)
HAdd
(
NotificationDoctor
)
Denunciar
0
0
ARV
#2
Membro registado
498 mensagems
Popularité : +8 (8 votes)
Publicado em abril, 17 2021 - 6:40 PM
Hi
I'm interesting about this it could help me but correct me if I'm wrong
I only see on the fractment of the code that you create a table .fic then you will add info on that table
Do you use a Trigger to send the notification?
Or with the server on HFSQL use a scheduled task to execute the stored procedure?
I know that the stored procedure of HFSQL only will execute if a project execute it (I really wish I know a way to execute it alone without this)
Do you try to execute the stored procedure with only the timer of HSQL?
Hope we can figure this out this could help you, help me and help everyone else.
--
Best Regards
ARV
Denunciar
0
0
Thomas Soegiarto
#3
Membro registado
3 mensagems
Publicado em abril, 19 2021 - 4:53 AM
Hi ARV, Thank you for the response. I don't use Trigger to send notifications. I only use "schedule a task" directly on the HFSQL server where the timer is set every 10 minutes. I've tried to execute the stored procedure with "HExecuteProcedure" in the android application that I developed and runs well. My application can receive notifications from NotificationDoctor.FIC, but I think this method is not good because if the mobile app is closed, the stored procedure will not work. That's why it has to be run directly on HFSQL server.
Denunciar
0
0
ARV
#4
Membro registado
498 mensagems
Popularité : +8 (8 votes)
Publicado em abril, 19 2021 - 3:45 PM
Hi Thomas
Maybe just maybe following this link:
https://help.windev.com/…
And the code you provide I suppose it's the store procedure of HFSQL C/S
well on that code you follow everything PCSoft says but I don't see nothing of executing the stored procedure of the data base.
I'm not familiar with this schedule task thing but maybe the notification it's not running because on the procedure of the schedule task never call the procedure of the notification
Not sure about this but you could try and see if it works.
The code you post talk about to access the .fic on your DB and save data on that table but never runs the procedure containing the notification
I'm guessing rigth here if you have a stored procedure for the notification
Also if this procedure have any other access to another table instead of NotificationDoctor make sure to use HDeclareExternal.
Hope I could guide you to the right direction.
And if it works make sure to post it to make everyone knows the solution and also for me
Also when you have the answer what version of Windev Mobile are you using?
And what type of code do you use to send the notification?
I use on the past HSendNotif but it's stop working because Android and iOS change a lot the code for the notification from Windev23 (version that I'm using) so I need to update to be able to use this notification methods
If you use code from Android or in iOS use Xcode code this could be helpful too.
Good luck!
--
Best Regards
ARV
Denunciar
0
0
→ Voltar para WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto