on 2011 Jun 08 12:36 PM
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.
UPDATE
SET change_dttm = TO_TIMESTAMP('6/7/1991 08:18:15', 'YYYY-MM-DD HH24:MI:SS') WHERE table_name = '<some table="">';or
UPDATE
Thanks in advance for any help
Request clarification before answering.
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;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
30 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.