Re: Informix produces error -1263 after system time is changed
Posted in 2006
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Thanks for the advice Marco and all of you guys who responded back... Actually this is my first post and you are right.. I should have been more specific to get specific answers. So I will give a full example below of how I can produce this error. Actually the source of the original program is written in esql so I will use esql to give an example. The OS is SCO, the informix version is defined above and that also applies to USEOSTIME variable. Example Code: int main(void) { $char stmt[1000]; $whenever error stop; $database 'mydb; $create table 'mydb'.testtable(serno serial, timestamp datetime year to second, strnumber char(25) ); strcpy(stmt, "insert into 'mydb'.testtable(timestamp, \\ strnumber) values \\ ( CURRENT, \\ ?)"); $prepare i_prep from $stmt; strcpy(stmt,"123456"); $execute i_prep using $stmt; printf("after insertion and before sleep\\n"); sleep(10); /* now suppose I give at the terminal the below within the 10 seconds * #date * screen --> Tue Dec 12 01:09:44 GMT 2000 * now I change the system time to * #date -u 12120009 * screen --> Tue Dec 12 00:09:00 GMT 2000 * * and at the execution below informix produces error 1263 */ strcpy(stmt,"4567890"); $execute i_prep using $stmt; } I paste here the finderr description of the error: ------------------------------------------------------------------ bash-2.03$ finderr 1263 -1263 A field in a datetime or interval is out of range or incorrect. Inspect the DATE, DATETIME, and INTERVAL literals in this statement; at least one of them contains at least one incorrect field. In a DATE or DATETIME literal, the year might be zero, the month might be other than 1 to 12, or the day might be other than 1 to 31 or inappropriate for the month. Also in a DATETIME literal, the hour might be other than 0 to 23, the minute or second might be other than 0 to 59, or the fraction might have too many digits for the specified precision. In an INTERVAL literal, the constraints are the same except that the first field is a count and can have as many digits as the qualifier specifies. ---------------------------------------------------- I notice that the original program does many preparations through a function call at the beggining and never reprepares the queries again. What I want to know is if there is a way to make the program robust enouph to such changes so that informix does not give that error. Thanks again
Second test with 4gl: ------------------------------- main define stmt char(100) define mytime datetime year to second whenever error stop let stmt = "insert into testtable(timestamp, strnumber) values (CURRENT,?)" create table 'online'.testtable(serno serial, timestamp datetime year to second, strnumber char(25) ) prepare i_prep from stmt sleep 10 let mytime = current display "mytime is ", mytime let stmt = "12345" execute i_prep using stmt end main -------------------------------- The thing here is that before the execution that produces an error, I display the current datetime correctly based on the change that I did on the host like in the previews example.
Related threads
- Informix produces error -1263 after system time is changed
- java.sql.SQLException: Could not position within a table
- Table locking problem.
- Error 1263 from dbaccess