Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: TimeStamp and Select * in TADQuery Error
TimeStamp and Select * in TADQuery Error
Posted: 2007/08/22 14:50
 
Hello,

If I try this:
ADQuery1.Active:= false;
ADQuery1.SQL.Clear;
ADQuery1.SQL.Add('select * FROM TestTable');
ADQuery1.Active:= true;

I get an Exception :
[AnyDAC][Phys][Ora]-1315 Bad or undefined variable[] value type 0 (NOE7/VAR)

It comes erverytime, I have the Datatype TIMESTAMP in a Table.

Is this a Bug?
I think the Datatype TIMESTAMP is new in Oracle...

Thanks
Tim.

Post edited by: Timbo, at: 2007/08/22 15:02
Re:TimeStamp and Select * in TADQuery Error
Posted: 2007/08/23 00:59
 
Hi Tim,

at the moment, AnyDAC doesn't support ORACLE's timestamp data type (see: AnyDAC roadmap):

Version 2.0:
Support for Oracle TIMESTAMP data type.


Until that, you can use 'date' and execute

 Query1->SQL->Text "alter session set NLS_DATE_FORMAT = 'yyyy-mm-dd hh24:mi: ss'";   // NO blank between mi: and ss - it's only to avoid smily! Query1->ExecSQL();

right after opening database. Then you can set a 'Timestamp' by

 Field->AsString(FormatDateTime("yyyy-mm-dd hh:nn: ss"Now());   // NO blank between nn: and ss - it's only to avoid smily!


That works for me.

Regards Knut

Post edited by: knulo, at: 2007/08/23 01:10
Re:TimeStamp and Select * in TADQuery Error
Posted: 2007/08/23 03:29
 
Thank you Knulo,

but I need "select *"...
Because I want to read the Colnames from different tables...

function getTableCols(InputTable: String): String;
var i: Integer;
begin
ADQuery.Active:=false;
ADQuery.Sql.Clear;
ADQuery.Sql.Add('select * from '+InputTable);
ADQuery.Active:=true;
for i:=0 to ADQuery.FieldCount-1 do begin
result:= result+','+ADQuery.Fields[i].DisplayName;
end;
end;


If I only want to read only a Timestamp I use:
SELECT To_Char(LastChange,''DD.MM.YYYY HH24:MIS'') FROM Table

Any idea for a work around?

Thanks
Tim (from Hamburg, Germany)
Re:TimeStamp and Select * in TADQuery Error
Posted: 2007/08/23 05:06
 
Hello

In v 1.x is no other workarounds, than Knut suggested.
Either use it, either wait 2.0.

Regards,
Dmitry