Direct Loading Dates

umayr

Member²
Hi
I am trying to load dates (and times) into a table.
Using Tquery, i can setvariable of date type and assign a tdatetime.
How can i input date (and TIME) into a date field using TOracleDirectLoader. I do not see a date type in the variables defining dialog.

Rgds
Umayr
 
Dates can only be loaded as strings. The TDirectPathLoader component has a DateFormat property to set the global date format, and each individual column definition can override this in its own DateFormat property.

------------------
Marco Kalter
Allround Automations
 
Thanks Marco,
I am still having problem here. If u can pls chk this code for me.

..
var date1a : string; {01/07/00 14:02:01}

// i put a Oraloader component on the form
// i set dateformat = 'dd/mm/yy hh:mi:ss' and session and table

begin // begin a loop
loader.columns[0].. //assign string data
..
//here comes the date column
Loader.Columns([3].SetData(loaderRow,@Date1a,length(Date1a));

// inc row
Inc(loaderRow);
end;
//end loop

Loader.Load(Row); //gives error
error : non numeric found where numeric expected. column = 3, row = 0;

It is expecting a numeric date format?.
Am i missing an obvious step here? pls help.

Thanks again
ushafeeu
 
From your code example it seems that you pass the address of the string (@Date1a) instead of the address of the first character of the string (@Date1a[1]). This would definitely cause conversion errors.

------------------
Marco Kalter
Allround Automations
 
Hi
I finally managed to get it working.

I missed the step to define a collection of records and populate the list. before calling the Load procedure. And yes, I had to use the list.record[1] to point to 1st char of the field.

Thanks
U Shafeeu
 
Back
Top