turingpattern
Computer
- Jul 14, 2005
- 1
Hi
I have a table with seven entries. They are pictures, each one of them for a day of the week. Now I have an application in jsp to be able to change the picture.
But what I want to do it is an automatic process so that they change without my intervention.
I have a SQLServer 7.0
I have begun to read on triggers and stored processes and am taking ideas.
The code is easy, some like that:
SELECT idfoto AS idactual FROM FOTOPORTADA WHERE visible=1 AND seccion = 1
IF (idactual=41) // Mon
UPDATE FOTOPORTADA SET visibleweb = 0 WHERE idfoto = 41
UPDATE FOTOPORTADA SET visibleweb = 1 WHERE idfoto = 42
IF (idactual=42) // Tue
...
[/color red]
What I do not know is how to use the parameter that I obtain from the first SELECT (idactual) in the rest of code, to pass it to it to the IF. Some idea?
Thank you very much
I have a table with seven entries. They are pictures, each one of them for a day of the week. Now I have an application in jsp to be able to change the picture.
But what I want to do it is an automatic process so that they change without my intervention.
I have a SQLServer 7.0
I have begun to read on triggers and stored processes and am taking ideas.
The code is easy, some like that:
SELECT idfoto AS idactual FROM FOTOPORTADA WHERE visible=1 AND seccion = 1
IF (idactual=41) // Mon
UPDATE FOTOPORTADA SET visibleweb = 0 WHERE idfoto = 41
UPDATE FOTOPORTADA SET visibleweb = 1 WHERE idfoto = 42
IF (idactual=42) // Tue
...
[/color red]
What I do not know is how to use the parameter that I obtain from the first SELECT (idactual) in the rest of code, to pass it to it to the IF. Some idea?
Thank you very much