0

I have table t1 with three columns, and a file per line a text.
my tables contains id,sura and aya fields. I need to fill only aya from File. I use the following command:
load data infile '/home/mohsen/codes/haq/translation-tmp/fa.ghomshei.txt' into table tr_fa_ghomshei LINES TERMINATED BY '\n' ;

Now question is :
How can I limit to aya field?

0
load data infile '/home/mohsen/codes/haq/translation-tmp/fa.ghomshei.txt'
    into table tr_fa_ghomshei
    LINES TERMINATED BY '\n'
    (@id, @sura, aya) ;

Then simply ignore @id and @sura.

But... Are you loading into a table with only one column? If the table has multiple columns, this won't work, and you need to explain what are really doing.

1

You can do : load data infile '/home/mohsen/codes/haq/translation-tmp/fa.ghomshei.txt' into table tr_fa_ghomshei LINES TERMINATED BY '\n' (aya);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.