I am trying to retrieve a timestamp value, set that value to a DateTime variable, then Insert that timestamp back into a different table, everything I have tried has not worked for me so far.
UPDATESET change_dttm = TO_TIMESTAMP('6/7/1991 08:18:15', 'YYYY-MM-DD HH24:MI:SS') WHERE table_name = '<some table="">';
Thanks in advance for any help
asked 08 Jun '11, 11:36
Are you using ORACLE as the database system?
AFAIK, TO_TIMESTAMP is not a SQL Anywhere function.
With SQL Anyhwere, you can usually insert timestamp values directly as string literals - with implicit conversion, such as:
create table T_Test (pk int primary key, dt timestamp not null); insert T_Test values (1, '2011-06-08 16:20:12.345678'); select * from T_Test;
When using different formats (like DD/MM/YYYY...), you will have to adapt the date_order option, possibly only temporarily:
insert T_Test values (2, '08/06/2011 16:20:12.345678'); -- fails with SQLCODE -157 set temporary option date_order = 'DMY'; insert T_Test values (2, '08/06/2011 16:20:12.345678'); -- works now select * from T_Test;