Home » Performance » MySQL » how to give path of the file in load data file syntax
| how to give path of the file in load data file syntax [message #3382] |
Fri, 08 August 2008 02:11  |
sudhir Messages: 4 Registered: August 2008 |
Junior Member |
|
|
Hi All,
can anyone please tell me how i can provide the path of the file(from which i want to load data) in load data infile syntax.
I m using mysql on linux platform and made a querry as follows.
LOAD DATA INFILE "MyFile" INTO TABLE TB_MRR FIELDS TERMINATED BY ',' IGNORE 1 LINES (NodeName, RecordId, resolution, opc, OrigRsId, origRsName, dpc, DestRsId, destRsName, finalDpc, finalRsId, finalRsName, si, gttDone, icLsId, icLsName, ogLsId, ogLsName, icNumSifOct, ogNumSifOct, icSsn, icGtDigits, icGtFrmt, icTT, ogSsn, ogGtDigits, ogGtFrmt, ogTT, isMsgSnt, msgTypeRx, msgTypeTx, svcMsgType);
executing above caommand gives the error as below.
ERROR 1105 (HY000): File '/var/lib/mysql/m7db/MyFile' not found (Errcode: 2)
[Updated on: Fri, 08 August 2008 02:13]
|
|
|
| Re: how to give path of the file in load data file syntax [message #3383 is a reply to message #3382 ] |
Fri, 08 August 2008 03:46   |
sweet Messages: 3 Registered: August 2008 |
Junior Member |
|
|
input an absolute or relative pathname before a filename.
here is an example.
LOAD DATA INFILE "/MyPath/MyFile" INTO TABLE TB_MRR FIELDS TERMINATED BY ',' IGNORE 1 LINES (NodeName, RecordId, resolution, opc, OrigRsId, origRsName, dpc, DestRsId, destRsName, finalDpc, finalRsId, finalRsName, si, gttDone, icLsId, icLsName, ogLsId, ogLsName, icNumSifOct, ogNumSifOct, icSsn, icGtDigits, icGtFrmt, icTT, ogSsn, ogGtDigits, ogGtFrmt, ogTT, isMsgSnt, msgTypeRx, msgTypeTx, svcMsgType);
it's simple.
[Updated on: Fri, 08 August 2008 03:54]
|
|
|
| Re: how to give path of the file in load data file syntax [message #3384 is a reply to message #3383 ] |
Fri, 08 August 2008 04:23  |
sudhir Messages: 4 Registered: August 2008 |
Junior Member |
|
|
thank you so much sweet .
i tried as u suggested it works fine when i m giving the command within mysql> LOAD........ .but actually i m trying the same comand using mysql_query(query_string)function,where query_string contains the same command as above.
In that case an error message is raised :
ERROR: Error while querying database insertion - File '/Mypath/MyFile
' not found (Errcode: 2).
|
|
|
Goto Forum:
Current Time: Thu Jul 9 21:44:40 EDT 2009
Total time taken to generate the page: 0.02452 seconds |