LOAD DATA INFILE :: Master & Slave
After recently replicating using the stop databases and copy innodb and mysql files method, things were fine...Until the slave thread stopped complaining about duplicate rows after one of our developers did a LOAD DATA INFILE operation on the master.
Unfortunately the insert's are into a table using AUTO_INCREMENT as well and this may be compounding the problem.I have read the docs, but it's sort of unclear, does LOAD DATA INFILE work in a replicated 3.23.56-1 setup, only under certain circumstances, or not at all?
View Complete Forum Thread with Replies
Related Forum Messages:
LOAD DATA :: Master & Slave Server
I was doing replication using MYISAM table types. When I set up my database server on the Slave, I used to LOAD DATA FROM MASTER to get the first snapshot of my running master. This worked great. Now we moved to using InnoDB table types to get rollback/commit features and also to enforce Foreign key checks. I read that current version of InnoDB does not support LOAD DATA FROM MASTER command. I would like to be able to setup my slave without taking down the server. Is there a way to do so without buying the InnoDBHotBackup.
View Replies !
Master Slave Replication Working But Slave Log Name Stuck?
I have been checking SHOW SLAVE STATUS; and keeping an eye on it. It lags but seems to be still going. However. Today I notice that the Master_Log_File changed from domain-bin.000001 to domain-bin.000002 and the Read_Master_Log_Pos from a really high 6 dig number to a low number, but the Relay_Log_File didnt change. it still says slavedomain-relay-bin.000001 and a really large growing number for: Relay_Log_Pos
View Replies !
Load Data Infile :: Load Key
My question is this I need to load a file (b/c of the size I don't want to use insert statements) with load data local infile. The problem is I need to add a static value to each record created by the load that will serve as the key. In version 5 of MySql this is no problem because I can use set w/ load data infile to accomplish what I need. However I need to do this in an older version. Any thoughts on how I could pull this off?
View Replies !
LOAD DATA INFILE To Import Data Exported From A MS Access Xp
I am trying to use LOAD DATA INFILE to import data exported from a MS Access Xp table. But all i get in the date field is 00:00:00, as Access exports DATE and TIME and MySQL seems to use just the TIME portion of this. Is there any way to ahve MySQL import just the DATE portion or is there any way to have Access export only the DATE portion?
View Replies !
How To Export Data From Phpmyadmin Into LOAD DATA INFILE Syntax
I have a table with a lot of data (several millions of records). I would like to export the data using phpmyadmin into a SQL file. I know that phpmyadmin has an export feature. I need the exported data to be in the LOAD DATA INFILE format after the export. Is there a way to achieve this? Regular export uses the INSERT INTO ... syntax for the data.
View Replies !
Load Data Infile &
I am building a web app to load data into MySQL db from an uploaded file. When using LOAD DATA INFILE, if I do not use LOCAL, does a client (viewing my web page) need to have any MySQL client components installed locally? I guess not if all processing takes place on the server, but I just thought I'd double check. Also, is there a way to manipulate data inserted with LOAD DATA INFILE, say I want to remove all special characters from strings before loading data. And finally, is there a way of mimicking Oracle's translate function in MySQL?
View Replies !
LOAD DATA INFILE
we are having a multi language website. There are two files responsible for the german and the english version. Now I wanted to change this to a database driven version, so I can check if the translation already exists etc... So I built a table with five fields: Code: id constant lang_de lang_en area Next I took the (modified) german language file which looked like this: Code: _CITY","Ort _COUNTRY","Land _FON","Telefon and did a a load data infile with mysql: Code: LOAD DATA INFILE '/tmp/_language/german.txt' into table language fields terminated by '","' lines terminated by ' ' (constant,lang_de) SET area = "Test"; Now I need to do the same with the english language file, but I dont want the constant field to have dublicates. Thus I want to ADD the equivaltent english phrase into the lang_en field.
View Replies !
Complex LOAD DATA INFILE
I am using mysql 5.0 and I want to load a huge txt-file in my database. My text file (file.txt) looks like: col1 col2 col3 ... col200 col1 col2 col3 ... col200 .... col1 col2 col3 ... col200 I now want it to import in a table t1 with two columns (col_nr, col_val) where col_nr is the number of column (e.g. 2 for col2, 46 for col46) and col_val are the effective values in my txt-file at the different columns. The problem is that col_nr is not in the "file.txt" so I have to assign based on the field number. I am looking at the LOAD DATA INFILE command, but in the help file I did not find an answer to my question. I was hoping to do it with: LOAD DATA INFILE 'file.txt' INTO TABLE t1 (col_val) SET col_nr = "how do I do this"; Does anyone has any suggestions or tips to do it differently (with php perhaps)?
View Replies !
LOAD DATA INFILE :: Using PHP Script From
I need to use LOAD DATA INFILE on files currently in /home/[user]/public_html/ via a PHP script. Evidently, because of MySQL's permissions on the filesystem, it won't be able to access the file unless it is is in MySQL's data directory, on my system, /var/lib/mysql/[db]/. What would be my best course of action? My goal is to run a PHP script in public_html and import my CSV files. Should I have the PHP script move the file to some other location accessible by MySQL (though I think it may not be able to do that because of permissions as well?) or allow MySQL to access all directories up to public_html? (how would I do this safely/securely?)
View Replies !
LOAD DATA INFILE :: Last Insert ID
I noticed when i used the last insert id method in mysql after running a LOAD DATA INFILE query, 0 is returned, even though the query was successful. Is there a function I could use alternatively, or perhaps an option that I need to change.
View Replies !
Load Data Infile Permissions
I'm trying to import data using the mysqlimport tool, however I get a "Error: Access denied for user 'ODBC'@'localhost' (using password: NO)" message. Where can I change the permissions for this or how do I use a username and password within the 'load data infile' command.
View Replies !
LOAD DATA INFILE Issue
When I import a text file using LOAD DATA INFILE...any nulls are replaced by "zeroes". In the text file, nulls are shown as two adjacent semicolons ";;". I want it to show as "NULL", without editing the input text file which are very large. Is there anything I can do? Perhaps, a parameter I am missing? It seems to work with GUI tools such as Navicat, but I need to use the command line.
View Replies !
A Load Data Infile Question
I have two txt files ( file1.txt and file2.txt) that I want to load into a table in the database. I use the following commands: load data infile <File path>file1.txt into table mytable; load data infile <File path>file2.txt into table mytable; The second load statement appears to overwrite the data in the table. How do you load two data files into a table in a mysql DB?????
View Replies !
LOAD DATA INFILE ErrCode: 13
I use LOAD DATA LOCAL INFILE... to upload some CSV files. All of them are in the same folder on my client pc. All of them have the same structure. All of them are loaded into the target table but ONE! This one was working before already. Now I always get an error message: File '.....' not found (Errcode: 13). Could it be that this file is too large? Are there limits? Actually the file is 350MB.
View Replies !
LOAD DATA INFILE And Max_binlog_cache_size
I am trying to load a large table using this command from a SQL script: LOAD DATA LOCAL INFILE 'E:/big.csv' INTO TABLE `scratch`.`verybig` FIELDS TERMINATED BY ',' ENCLOSED BY '"' (@ignore, col1, col2, col3, col4, col5, col6); And I run into this problem: ERROR 1197 (HY000) at line 20: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again I've read about this variable and the max and default value is 4GB and I am at the default value so I cannot go any higher. I am using InnoDb with binary logging turned on so I can replicate. How do I get around this issue if I cannot make max_binlog_cache_size any bigger than it already is? Code:
View Replies !
LOAD DATA INFILE + ENUM
I'm working with MySQL 5.0.45-community-nt MySQL Community Edition (GPL) I have a problem with loading data into a table. The table looks like this: +--------------+-------------------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------------------------+------+-----+---------+-------+ | ProductID | varchar(6) | NO | PRI | | | | Omschrijving | varchar(20) | NO | | | | | Lengte | tinyint(3) unsigned | NO | | | | | Breedte | tinyint(3) unsigned | NO | | | | | Hoogte | tinyint(3) unsigned | NO | | | | | Type | enum('HEV','ELV','MOT','FIX') | YES | | NULL | | +--------------+-------------------------------+------+-----+---------+-------+ Does anyone know how I have to format the CSV-File to import data into the table. When I load data into the table, the column 'Type' is empty. example of csv-file: 000001;omschrijving1;19;7;7;"4" 000002;omschrijving2;19;8;7;"4" 000003;omschrijving3;19;9;21;"2" 000004;omschrijving4;19;9;7;"4" 000005;omschrijving5;19;7;9;"4" 000006;omschrijving6;19;7;11;"1" I also tried it without double quotes, with single quotes and with the values ('HEV','ELV','MOT','FIX') of the enum, also with and without double/single quotes
View Replies !
LOAD DATA INFILE -- Errcode: 13
try to load our data in our database by this command, we get this error: LOAD DATA INFILE '/path/to/file.txt' INTO TABLE dbname.dbtable FIELDS TERMINATED BY ' '; ERROR 13 (HY000): Can't get stat of '/path/to/file.txt' (Errcode: 13) This means a permisson error. (Errcode: 13) Whe changed CHMOD of the map and the importfile to 755, but the error still occurs. Normally, we used the LOAD DATA LOCAL INFILE function, but this function is disabled in the new mysql version.
View Replies !
LOAD DATA INFILE - WHERE Clause
table: ---------------------------------------- | number | date | color | letter | ---------------------------------------- what I want to do: LOAD DATA INFILE 'file' INTO TABLE table (@number, @date) SET date = @date WHERE number = @number It doesn't like the 'WHERE' clause. I want to keep data i have in other fields of that table, just simply update the `date` field. If i simply run this: LOAD DATA INFILE 'file' INTO TABLE table (number, date)
View Replies !
AUTOINCREMENT With LOAD DATA INFILE
I have a 2-column table with a primary key that I want to auto-increment when I load a data file, but it's generating an error for me. CREATE TABLE MySample( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, data VARCHAR(100) ); My data file is 1-column and I thought the point of the auto-increment was to automatically assign and number an id upon data load. mysql> LOAD DATA INFILE 'C:\_mysqlFruit.txt' INTO TABLE MySample; It BEEPS and gives me this error: ' for column 'id' at row 1ect integer value: 'Apples mysql>
View Replies !
LOAD Data Infile Statement
I have a very urgent problem in which I need to pass a variable representing a file name to the LOAD DATA INFILE statement. For example, SET @FILEN = 'c: empfilename.txt'; LOAD DATA LOCAL INFILE @FILEN INTO TABLE my_table; I have very many text files, but crucially the file names change every week as the filenames themselves include the date as part of the file name. Consequently, I need to be able to compute the filename.I have tried to create a stored procedure. However, it will not work.
View Replies !
Load Data Infile Not Working
why doesn't this work? LOAD DATA INFILE 'data.txt' INTO TABLE db_tbl FIELDS TERMINATED BY ' '; On the old website. I've duplicated the table, and given the user the correct permissions. I preseume it has something to do with the mysql update, though I dont know what version the new one is. How do I determine that? The import works as su issued from the command line, but not from the php script. It does give me warnings upon completion, however. The script works fine on the old server. And the user is able to delete the data in another line of the same script.
View Replies !
LOAD DATA INFILE PROBLEM
I have the following script. It works perfectly with 5.0.9-beta-nt-log using browser 1.1.9. It does not work with version 5.0.18-nt using Browser version 1.1.19. I would really appreciate any help. USE SWEDEN; TRUNCATE TABLE OIPW; TRUNCATE TABLE OBDFI; LOAD DATA LOCAL INFILE 'C:TEMPNew FolderSWEC20050215.TXT' INTO TABLE OBDFI FIELDS TERMINATED BY ';' LINES TERMINATED BY ' ' IGNORE 1 LINES (OblID, Name, Addr1, Addr2, Addr3, Addr4, Cntry, PrntID, IntrnlI, GvtI, BnkrptI, @Anlys_0, IndC, StatC) SET OrigID = 'SWE', FileDT = 20050215; LOAD DATA LOCAL INFILE 'C:TEMPNew FolderSWEW20050215.TXT' INTO TABLE OIPW FIELDS TERMINATED BY ';' LINES TERMINATED BY ' ' IGNORE 1 LINES (ItemID, OblID, OSAmt, Curr, InvDT, DueDT, @Status, TrnsType, @RsnCode) SET OrigID = 'SWE', FileDate = 20050215;
View Replies !
LOAD DATA LOCAL INFILE
Here's what I'm trying to run: LOAD DATA LOCAL INFILE 'C:Junk est.txt' INTO TABLE testtable I get file 'C:Junk|est.txt' not found (Errcode: 22) (yes, it does have a pipe symbol in there). Any ideas? I'm guessing I need to do something special with the file, but I don't know what. Also, how do I run mysql_get_server_version()? Should I just be able to run this command in the MySql query browser? It gives an error (error in sql syntax).
View Replies !
LOAD DATA INFILE Syntax Error
I am attempting to import a large file with data in this format: 1923158|GA|1996 Olympic Yachting Cauldron|park|Chatham|13|051 |320446N|0810502W|32.07944|- 81.08389||||||||Savannah With this command: LOAD DATA LOCAL INFILE 'C:PHPFL_DECI.txt' INTO TABLE locations2 FIELDS TERMINATED BY '|' LINES TERMINATED BY " " (@d,@d,LOCNAME,LOCTYPE,@d,STATE,COUNTY,@d,@d,LNG,L AT,@d,@d,@d,@d,@d,@d,@d,@= d); The @d is a dummy variable for information I do not need to import. The table structure looks like this: +---------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------+-------------+------+-----+---------+----------------+ | ID | int(11) | | PRI | NULL | auto_increment | | STATE | int(11) | YES | | NULL | | | LOCNAME | varchar(25) | YES | | NULL | | | LOCTYPE | varchar(10) | YES | | NULL | | | COUNTY | int(11) | YES | | NULL | | | CTRLAT | float | YES | | NULL | | | CTRLNG | float | YES | | NULL | | +---------+-------------+------+-----+---------+----------------+ And here is the error I get: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@d,@d ,LOCNAME,LOCTYPE,@d,STATE,COUNTY,@d,@d,LNG,LAT,@d, @d,@d,@d,@d,@d,@d,@d)' at line 5
View Replies !
Replication And LOAD DATA INFILE MySQL Max 3.23.56-1
After recently replicating using the stop databases and copy innodb and mysql files method, things were fine... Until the slave thread stopped complaining about duplicate rows after one of our developers did a LOAD DATA INFILE operation on the master.=20 Unfortunately the insert's are into a table using AUTO_INCREMENT as well and this may be compounding the problem. I have read the docs, but it's sort of unclear, does LOAD DATA INFILE work in a replicated 3.23.56-1 setup, only under certain circumstances, or not at all?
View Replies !
LOAD DATA LOCAL INFILE And Perl DBI/DBD
For the past several months we have been using LOAD DATA LOCAL INFILE to bulk load tables within Perl modules. Recently, someone thought it would be a good idea to upgrade the Solaris machines - I'm thinking it wasn't that good an idea :-( We are now running MySQL 4.0.18 and the DBI version is 1.35. Now, our scripts are failing with the dreaded "The used command is not allowed with this MySQL version" message. Here's what I know at the moment: 1. mysqld has local infile enabled. 2. mysql client can perform a LOAD DATA LOCAL INFILE 3. dbimon cannot perform a LOAD DATA LOCAL INFILE (same message as above). So as I understand this, DBI is somehow not allowing the local option. I tried adding the local_infile=1 option on the DSN, but that didn't help (if there was an error, it was silently ignored). Two questions: 1. How can I get the LOCAL option working? 2. How can I identify the source of the problem better so we don't waste more time in the future?
View Replies !
Can't Get Stat Errcode 13 With LOAD DATA INFILE
Can't get stat Errcode 13 I am having a problem with some legacy code that won't work properly due to a mysql error This code is used once a month to upload sales data on my dedicated server. Last month it worked fine. Since then I have updated my server using cpanel. My system shows that I am using mysql 3.23.49 and PHP 4.3.10 I get the error = line 165 Can't get stat of '/home/xxxxxx/public_html/PHP/Brick/xxx Sales Feb05.txt' (Errcode: 13) The file is there and the file permissions are set to 777 The code is: $result_load_file= mysql_query("LOAD DATA INFILE '/home/xxxxx/public_html/PHP/xxx/$file_nm' INTO TABLE $db.ld_data ($td)",$conn) or die(" line 165 ".mysql_error()); $file_nm holds the correct file name. I have to assume that this is due to a change in my mysql version. It worked fine last month. I upload the files for several organizations. Because of differences in the data structure of their files, I use a separate program for each. All fail at this same code. I could only find some references to this problem from 2000 and 2001 when I searched the forums.
View Replies !
Is It Possible:update Records In LOAD DATA INFILE
i have a 300,000 rows backup as .csv file for a table. which makes it 117 mb. i uploaded it once in the db but it has entered only primary keys and nothing else. all other columns are blank. i want to dump this data again but do not want to add 300,000 new records. I want to replace the old ones that are wrong in the live db with the correct entries. I think --replace will replace only if an identical row is found and not based on the primary key. Is there anyway to do this?
View Replies !
LOAD DATA INFILE :: File Privileges
I've done some seasrching around because the LOAD DATA INFILE SQL statement would not work in my script, and I found that the FILE privilege needs to be granted to a user. How do I go about doing this? Is it possible from phpMyAdmin?
View Replies !
LOAD DATA INFILE Creating With Commas
LOAD DATA LOCAL INFILE '/home/data.csv' REPLACE INTO TABLE clicktest FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY ''; wherever the comma appears it takes it as an end of the field and hence give warning of more columns than the schema. I tried using a different separator i.e &&&& and enclosed values in %%%% but now it gives me wrong field terminator error, i think i cannot use 'any' symbols for this.
View Replies !
LOAD DATA INFILE Tagged Format
I have some files in a tagged format similar to the example below - *a TAGa vala TAGb valb TAGc valc TAGd1 vald1 TAGd2 vald2 TAGd3 vald3 TAGd4 vald4 TAGe vale $ Records always start with "*a" and end with "$". The number of fields in the record is variable. In the example above there are four instances of TAGd - 1,2,3 and 4. There will be between zero and ten instances of this field in each record. Similarly TAGc may, or may not, be present in each record. Currently I import these files using a PHP script but I would like to know if it is possible to do it with LOAD DATA INFILE or even a STORED PROC. There are upto 50k records in each file, with each record having upto 60 fields. The average file size is about 30MB.
View Replies !
Load Data Infile :: FILE Privilege
I am trying to load a text file located in my public_html folder into a MySQL database table. I do not own the server, but use a hosting company.I am able to 'insert' data, so the connection is good, but I am unable to 'Load Data Infile' owing to the fact that my hosting company are unsure how to grant me the FILE privilege, as they do not know what it is, and no-one there understands it Does anyone know of another way to read the contents of a text file into a MySQL table without having the FILE privilege enabled?
View Replies !
Help Needed With Load Data Infile Syntax
I'm relatively new to MySQL, and I've never used the Load Data Infile command. I'm having trouble getting it to work correctly. I have a comma separated file generated as output by another program that I can't seem to parse correctly. It contains data similar to the following: VAL1, LASTNAME, FIRSTNAME, ADDRESS1, ADDRESS2, ETC1, ETC2, ETC3 VAL2, "LASTNAME, JR.", FIRSTNAME, ADDRESS1, ADDRESS2, ETC1, ETC2, ETC3 The "LASTNAME, JR." hoses up the import. It imports "LASTNAME into one field and JR." into another.
View Replies !
Load Data Infile Creates 0 Instead Of Null
I am writing a Java program to populate the MySQL table xml_items. It needs to load data from a CSV (comma delimited) file. The load of the data works great when I run it except for one excpeiont. The column parent_reference_key may contain nulls or may be filled in a with a numeric value. In the file the field will either be referenced with nothing between the commans (,,) or with a numeric between the commas (,13,). For the records on the file that have nothing between the commans the database is defaulting the value to zero (0) instead of null, like it should be. For thet able setup on the database I have the default value as null. I also receive an exception message when I try to load this file: Upload SQLException # 5: Data truncation: Data truncated for column 'parent_reference_key' at row 1 which is related to the record(s) that have nothing between the commas. LOAD DATA INFILE '" + filePath + "' INTO TABLE xml_items FIELDS TERMINATED BY ',' " + "(pk, name, parent_reference_key, parent_name, data_type, xml_type, source_id, source_name); If the column will not default to a null value with there is nothing placed between the commas of the load file then what option do I have to load this file and create null values for that column?
View Replies !
Load Data Infile - Modify Values On The Fly
is it possible to modify values read from a file using "load data infile"? My textfile contains a types-column with redundant full text values that are already stored in an existing types table with id's for each entry. Instead of storing the full text values from textfile, I want to store the appropriate id's from the types table. Types table: id | type __________ 1 | "solid" 2 | "spline" textfile: 1 | solid | data | data 2 | spline | data | data [...] target table should look like: id | typeID | data1 | data2 ___________________________ 1 | 1 | data | data [...]
View Replies !
LOAD DATA INFILE - Problems Trying To Import CSV
mysql> load data local infile '~/Desktop/sdata.csv' into table sdata -> fields terminated by ',' -> (name, lat, long); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long)' at line 3 I'm trying to import this simple csv file into a table on MySQL and I can't seem to get it to work, I've been reading the forums and searching google and it looks like I'm doing everything correct. I'm sure that I'm missing something! Any advice would be greatly appreciated. for background the table was created with a Ruby Migration: class Newmig < ActiveRecord::Migration def self.up create_table :sdata do |t| t.column :name, :string t.column :lat, :integer t.column :long, :integer end end def self.down drop_table :sdata end end
View Replies !
Feedback From Load Data Local Infile
How can I capture message "Records: 1000 Deleted: 0 Skipped: 10 Warnings 10" when I load data using following command: mysql < load.txt > output.txt 2> errors.txt where load.txt contains "load data local infile...; show warnings;" statements. This way it only prints warnings into output.txt.
View Replies !
Output From LOAD DATA LOCAL INFILE
I am using the below method for uploading a text file into my database using DBI in perl.When I run this statement manually, logging into mysql, it doesn't produce much screen output. However, when I run it via the perl snippet, below,it echos all the lines of the database to the screen as it is presumably uploading/updating the mysql database.I can't figure out why, but I would like to prevent it from producing as much screen output. use DBI(); my $dbh = DBI->connect("DBI:mysql:database=mydatabase;host=my.host.com:3306", "myusername", "mypassword") or die "$DBI::errstr"; my $sql_load = "LOAD DATA LOCAL INFILE "/home/user/file.txt" INTO TABLE Membership FIELDS TERMINATED BY '||'"; $dbh->do($sql_load) or die "$DBI::errstr";
View Replies !
LOAD DATA INFILE :: Access Denied
When I try to issue a LOAD DATA INFILE statement from the MySQLAdministrator SQL page, I get the following error: #1045 - Access denied for user I am logged in and I have access to the file being processed, but still nothing. I've also tried this from a PHP script and get no response whatsoever. HOWEVER, if I use the Import tab from MySQLAdministrator, I am able to process the file just fine! How does this code differ from what I'm trying to do with the LOAD DATA INFILE command?
View Replies !
Formatting Date During LOAD DATA INFILE
I have a CSV file of data I wish to import using LOAD DATA INFILE and one of the columns is date. I have that column set to a date field type in the database but in the CSV file the date is in the format: DD-MMM-YY, i.e. 09-DEC-07 I can't change the format in the CSV file and when I currently load the data using the LOAD DATA INFILE all the dates get set to 0000-00-00. Is there a way to tell MySQL the formatting of the date in the LOAD DATA INFILE statement so it converts it to the correct format for MySQL to understand and there import.
View Replies !
Load Data Infile - Date Problem
I'm using 'load data infile...' and a text file to populate a table. This works fine except that a column containing dates is always null. The date's are in the format 'YYYY-MM-DD' and are quoted in the text file. I have tried several different formats but always get the same null date problem after the insert has happened. Can someone tell me where I'm going wrong?
View Replies !
Parse Argument To LOAD DATA INFILE
I've got a list of different csv files that I need to import and process that only differ by a particular date string on their names. For example: 20070928CharsLkUp.tsv 20070928CharsLkUp.tsv To import the first one I use: LOAD DATA INFILE '/mysql/20070928CharsLkUp.tsv' INTO TABLE a.data FIELDS ENCLOSED BY '"' LINES TERMINATED BY ' ' IGNORE 1 LINES; I'd like to be able to set a particular date and then use the concatenate function to parse the exact filename location as a parameter to the "LOAD INFILE FUNCTION". I've tried to use the following but it didn't work: set @date_import='2007-09-28'; set @file_name_import1:=concat('''/mysql/',replace(@date_import,'-',''),'CharsLkUp.tsv'''); LOAD DATA INFILE @file_name_import1 INTO TABLE a.data FIELDS ENCLOSED BY '"' LINES TERMINATED BY ' ' IGNORE 1 LINES; Can any help me? Am I allowed to parse values only to SELECT statements? I've tried to search the forums/manual but could not make it work.
View Replies !
|