Subject | Inserting TIMESTAMP literals from another table |
---|---|
Author | Joe Martinez |
Post date | 2005-03-07T11:10:02Z |
I am trying to generate an Insert statement that inserts a row that
includes some values from another table. One of these values is a
TIMESTAMP value. I'm trying to do something like this:
MyDSQL->SQL->Add("insert into Table1 (SomeValue,SomeTimestamp) values
('Hello', '" +
SomeCursor->FieldByName("AnotherTimestamp")->AsString + "'"
When I try to execute this, I get an exception, saying:
conversion error from string "3/7/2005 2:56:12 AM"
I'm guessing that Firebird doesn't like the literal format that IBO's
AsString method is generating.
How can I do this correctly? Is there a way to automatically generate a
string representation of the date that Firebird will accept as a valid
TIMESTAMP representation?
-Joe
includes some values from another table. One of these values is a
TIMESTAMP value. I'm trying to do something like this:
MyDSQL->SQL->Add("insert into Table1 (SomeValue,SomeTimestamp) values
('Hello', '" +
SomeCursor->FieldByName("AnotherTimestamp")->AsString + "'"
When I try to execute this, I get an exception, saying:
conversion error from string "3/7/2005 2:56:12 AM"
I'm guessing that Firebird doesn't like the literal format that IBO's
AsString method is generating.
How can I do this correctly? Is there a way to automatically generate a
string representation of the date that Firebird will accept as a valid
TIMESTAMP representation?
-Joe