This is a discussion on Syntax error in stored procedure within the Informix forums, part of the Database Server Software category; --> Hi, I have problems with one stored procedure that I am trying to develop in my informix database. The ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I have problems with one stored procedure that I am trying to develop in my informix database. The procedure is at folloews create procedure updateFlags(emp LIKE employee.idEmployee,check like dailycheck.checkdate) DEFINE selected integer; FOREACH cursor FOR select first 1 iddailycheck into selected from dailycheck DC where DC.idEmployee=emp and DC.checkdate=check and DC.modificationtype='PLANNED' order by DC.modificationdate desc; update dailycheck set lastPlanned=1 where iddailycheck=selected; end foreach; end procedure; I am using dbaccess, what the result is always the same.... Can you help me???? |
| |||
| loose the ; at > FOREACH cursor FOR select first 1 iddailycheck > into selected from dailycheck DC > where DC.idEmployee=emp and DC.checkdate=check > and DC.modificationtype='PLANNED' order by > DC.modificationdate desc; -------------------------^^---HERE------- see you Superboer. Unholy schreef: > Hi, I have problems with one stored procedure that I am trying to > develop in my informix database. > > The procedure is at folloews > > create procedure updateFlags(emp LIKE employee.idEmployee,check like > dailycheck.checkdate) > DEFINE selected integer; > FOREACH cursor FOR select first 1 iddailycheck > into selected from dailycheck DC > where DC.idEmployee=emp and DC.checkdate=check > and DC.modificationtype='PLANNED' order by > DC.modificationdate desc; > update dailycheck set lastPlanned=1 where iddailycheck=selected; > end foreach; > > end procedure; > > I am using dbaccess, what the result is always the same.... > > Can you help me???? |
| ||||
| Unholy try this: create procedure updateFlags(emp LIKE employee.idEmployee,check like dailycheck.checkdate) DEFINE selected integer; DEFINE dummydate like dailycheck.modificationdate; FOREACH cursor FOR select first 1 iddailycheck, modificationdate into selected , dummydate from dailycheck DC where DC.idEmployee=emp and DC.checkdate=check and DC.modificationtype='PLANNED' order by DC.modificationdate desc update dailycheck set lastPlanned=1 where iddailycheck=selected; end foreach; end procedure; have added dummydate since you order by modificationdate and just compiled and executed it on 930. have fun Superboer. |