Hi Zavier,

Zavier Sheran [mailto:[EMAIL PROTECTED] wrote:
> 
> I have to import a csv dataset and some fields that are 
> indexed in the table are not in the csv data. 
> 
> Loader gives an error stating that those fields are required. 
> 
> is there a way to import the data and set for the index 
> fields that are not available a default value?
> 
Yes.

> DATALOAD TABLE DBA.cars_used
> record_id 1 DEFAULT NULL
> dealer_name 2 DEFAULT NULL
> ..... (cut)
> car_make_display 10 DEFAULT NULL
> car_model_display 11 DEFAULT NULL
> INFILE 'cars_used.txt' COMPRESSED
> ASCII SEPARATOR '|'
> DELIMITER ''
> 
> I would like to add a few lines like
> 
> car_make_code DEFAULT '99'
> car_model_code DEFAULT '99'
> 
> to set a value of 99 to columns that are not represented in 
> the csv data
> 
> What is the correct syntax, if this functionality is 
> available at all? I could not find anything in the docs...
> 
> 
It depends highly on the version of the Loader you use. Starting with
version 7.4.03.32 the Loader loads arbitrary constants with
the following syntax (although it had been in the Loader for much 
longer but due to bugs didn't work the right way :-( ):

 DATALOAD TABLE DBA.cars_used
 record_id 1 DEFAULT NULL
 dealer_name 2 DEFAULT NULL
 ..... (cut)
 car_make_display 10 DEFAULT NULL
 car_model_display 11 DEFAULT NULL
 car_make_code '99'
 car_model_code '99'
 INFILE 'cars_used.txt' COMPRESSED
 ASCII SEPARATOR '|'
 DELIMITER ''

Concerning the docs (I know it's sometimes hidden) see:
http://dev.mysql.com/doc/maxdb/en/ec/d9405e400d11d3aa27006094b92fad/frameset.htm

Regards,
 Steffen
-- 
Steffen Schildberg
SAP DB Team
SAP Labs Berlin

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to