1

Is there a way to insert data into InfoBright tables using LOAD DATA style like from file

LOAD DATA INFILE '/usr/tmp/file2.txt' 
INTO TABLE test_table1 
FIELDS TERMINATED BY ',' ENCLOSED BY '"';

mysql> select * from test_table1; 
+------+-------------------+-----------+ 
| id | textfield | numerical | 
+------+-------------------+-----------+ 
| 1 | one, two or three | 1234 | 
| 1 | one, two or three | 1234 | 
+------+-------------------+-----------+ 
2 rows in set (0.00 sec)
    
dzona
  • 3,323
  • 3
  • 31
  • 47

1 Answers1

0

Yes, you can (EDIT: but only for external data)

In fact, if you're using Infobright's Community Edition, this is one of the only ways to get data into an Infobright table. Infobright Community Edition does not support DML which would allow for INSERT commands.

Infobright actually has a lot of good documentation and samples on their site and on their forums.

EDIT: An update per your comment (Assuming Community Edition, again)

If you want to get data from one table in InfoBright into another, you'll need to re-import it from an external data source.

Noah
  • 1,857
  • 15
  • 19
  • I'm not sure I asked my question correctly. Basically I want to copy data from one table in InfoBright to another, not restore data from third place – dzona Jun 25 '14 at 21:30
  • Updated answer. I'm assuming Community Edition. If you had Enterprise, you could just `INSERT INTO table1 SELECT * FROM table2;` – Noah Jun 25 '14 at 21:35
  • I have used `INSERT`, but was killing DB because of huuuuge amount of data. I can create table dump and use `LOAD DATA` to insert rows in new table, but is it worse than `INSERT` for that scenario? :-/ – dzona Jun 25 '14 at 21:42
  • If you're dealing with a huge amount of data, and you want to completely duplicate a table, you might be able to get away with copying the .frm and .bht files to a new target table name in your /data directory. – Noah Jun 25 '14 at 23:56