Sorry for the private answer hitted the wrong replay button.

It's possible for you unload data with an SQL like this ?

SELECT list, of, fields,
   MD5 ( CONCAT ( list, of, fields ) )
INTO OUTFILE 'file_name'
FROM tab

if not (probably, you have csv files), you must use a shell script like this (maybe slow)

#! /bin/sh
export SEP=";"
while read myline ; do
echo "${myline}${SEP}$(echo "${myline}" | md5sum | cut --characters=-32)"
done < /etc/fstab


in M$ windows you must find an alternative.

BIG WARNINGs!
- This solution implies that forever you will be sticked to the same method / program
- the md5 produced from the shell script will be different from the one produced from the database



shaun thornburgh ha scritto:

>Hi,
>
>Thanks for your reply, but the problem I am facing is that there may be duplicate values in the uploaded file and I dont want these to appear in my table...
>
>> From: Bastian Balthazar Bux <[EMAIL PROTECTED]>
>> To: shaun thornburgh <[EMAIL PROTECTED]>
>> Subject: Re: LOAD DATA INFILE using 4.0.17
>> Date: Tue, 15 Feb 2005 23:32:56 +0100
>>
>> shaun thornburgh ha scritto:
>>
>>> Hi,
>>>
>>> I have a table with 26 fields, each row in this table must be unique. I can't define all of the fields to be primary keys as the limit is 16. Therefore before I insert data I have to check that each row is unique. Data is to be inserted into this table from files uploaded to the server - CSV files. Is it possible to use the LOAD DATA INFILE statement to check for unique rows, or does anyone have a better solution to my problem!
>>>
>>> Thanks for any advice offered.
>>>
>>>
>>>
>> make a table of 27 fields ;) , use the MD5() function http://dev.mysql.com/doc/mysql/en/encryption-functions.html , simply add a unique index on the column that holds the md5 sum.
>>
>> Regards, Francesco
>





-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to