999ANDRE999 Posted March 9, 2017 at 12:15 PM Report Share #602997 Posted March 9, 2017 at 12:15 PM Olá Pessoal, Tenho uma BD postgres, onde necesito que de hora a hora uma query, que verifica se os dados que lá estão foram inseridos há mais de 2h e se sim invoca um web service, e coloca uma coluna a true. Existe forma de fazer isso pelo postgres? Qual será a melhor maneira de implementar o que necessito? Obrigado desde já. 👍 Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted March 9, 2017 at 01:21 PM Report Share #603000 Posted March 9, 2017 at 01:21 PM servidor unix/linux ou windows ? IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
999ANDRE999 Posted March 9, 2017 at 01:52 PM Author Report Share #603001 Posted March 9, 2017 at 01:52 PM é windows Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted March 9, 2017 at 02:22 PM Report Share #603004 Posted March 9, 2017 at 02:22 PM cria um script (na tua linguagem peferida) e executa-a de forma automática da seguinte forma : https://technet.microsoft.com/en-us/library/cc748993(v=ws.11).aspx 1 Report IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
M6 Posted March 9, 2017 at 04:01 PM Report Share #603007 Posted March 9, 2017 at 04:01 PM (edited) Podes usar um job com agendamento. Vê aqui: https://wiki.postgresql.org/images/5/54/PgAgent-FOSDEM09.pdf Edited March 9, 2017 at 04:04 PM by M6 Correção da resposta. 1 Report 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar." Link to comment Share on other sites More sharing options...
999ANDRE999 Posted March 10, 2017 at 09:42 AM Author Report Share #603027 Posted March 10, 2017 at 09:42 AM obrigado pelas dicas. Mas não consegui entender 😞 Nunca fiz nada parecido. Conseguem dar-me algum exemplo? A minha dificuldade maior está em invocar o webservice. Link to comment Share on other sites More sharing options...
M6 Posted March 10, 2017 at 10:47 AM Report Share #603031 Posted March 10, 2017 at 10:47 AM Tens aqui um exemplo: https://boundlessgeo.com/2012/04/http-for-postgresql/ O Postgres não suporta webservices de raiz, pelo que vais ter de trabalhar um bocado para fazer isso. 1 Report 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar." Link to comment Share on other sites More sharing options...
999ANDRE999 Posted March 10, 2017 at 01:47 PM Author Report Share #603037 Posted March 10, 2017 at 01:47 PM Tive a ideia de colocar um serviço a correr no servidor que fazia a consulta à BD e os dados que estivessem prontos a serem enviados para o webservice, invocava o webservice. Será possivel? Eu nunca desenvolvi um serviço. Link to comment Share on other sites More sharing options...
M6 Posted March 10, 2017 at 06:31 PM Report Share #603045 Posted March 10, 2017 at 06:31 PM Sim, é possível. Essa é a ideia que o HappyHippyHippo disse. 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar." Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now