Pass TimestampAttr to TOracleObject

MaDonath

Member
I would like to set a TimestampAttr of a TOracleObject:

TOracleObject* obj = new TOracleObject(mysess, "name, "");
TOracleTimestamp* ts = new TOracleTimestamp(mysess, otTimestampLTZ);
ts->SetValuesTZ(...);
obj->AddElement();
obj->ObjElements[0]->SetAttr("NR", 123);

attribute TM ist an Oracle timestamp but:
obj->ObjElements[0]->TimestampAttr("TM")->Assign(ts);
failes (invalid handle).

How is this to be done?

Markus
 
What happens if you set (for example) the Year property of the timestamp attribute to a constant like 2019?
 
Further tests:
TOracleTimestamp* ts = obj->ObjElements[0]->TimestampAttr("TS");
if(ts)
{
// yes, it's true;
if(ts->Session == mysess)
{
// yes, that's true too.
ts->SetValuesTZ(2019, 1, 18, 1, 0, 0, 0, 0, 0);
-> Exception: TOracleTimestamp: Invalid handle.
}
}
 
Back
Top