preparing sql with datetime using 7.30.UC1
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
(My apologies if this is posted twice, I sent it when the gateway was playing up.) Hello all, I have noticed that a string prepare that works on other 4gl versions running on HP-UX does not work on version 7.30.UC1 running on AIX, even though it will run quite happily in isql in the same instance. eg preparing "SELECT EXTEND( aassg.start_dtim, HOUR TO SECOND ) - ", "DATETIME(00:00) HOUR TO MINUTE start ", " from aassg " gives a syntax error -201, but preparing "SELECT EXTEND( aassg.start_dtim, HOUR TO SECOND ) - ", "DATETIME(00) HOUR TO HOUR start ", " from aassg " works ok. This is not really giving me any trouble at the moment, but I am curious as to why this should suddenly not work. Is this a bug in that version, or am I doing something wrong? Thanks, Sue
Umm, I think neither should work. The DATETIME constant in the subtrahend must be quoted IB: DATETIME( "00:00" ) HOUR TO MINUTE or DATETIME( "00" ) HOUR TO HOUR Art S. Kagel Sue_Davidson@exe.com.au wrote: > > (My apologies if this is posted twice, I sent it when the gateway was playing > up.) > > Hello all, > > I have noticed that a string prepare that works on other 4gl versions running on > HP-UX does not work on version 7.30.UC1 running on AIX, even though it will run > quite happily in isql in the same instance. > > eg preparing "SELECT EXTEND( aassg.start_dtim, HOUR TO SECOND ) - ", > "DATETIME(00:00) HOUR TO MINUTE start ", > " from aassg " > gives a syntax error -201, but > > preparing "SELECT EXTEND( aassg.start_dtim, HOUR TO SECOND ) - ", > "DATETIME(00) HOUR TO HOUR start ", > " from aassg " > works ok. > > This is not really giving me any trouble at the moment, but I am curious as to > why this should suddenly not work. Is this a bug in that version, or am I doing > something wrong? > > Thanks, > Sue
Sue_Davidson@exe.com.au wrote: : "DATETIME(00:00) HOUR TO MINUTE start ", Try DATETIME(0:00) HOUR TO MINUTE, I know it works on 9.20 -- Rob Wilson rwilson@ntsource.com