473,511 Members | 15,156 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

bulk load questions


hi,

i am using the perl DBI.

-- how can i make load_file read a blob. it treats the file contents as
a string rather than text/blob.

-- is there an ENV or mysql var to tell the engine where to find files
you want to load? mysql looks in ~ by default and i know i can use a
full path but it is reather long and cumbersome.

tia,
peter

Jul 20 '05 #1
1 2050
picaza wrote:
i am using the perl DBI.
-- how can i make load_file read a blob. it treats the file contents as
a string rather than text/blob.
LOAD DATA doesn't support blobs.

I have used DBI to insert blobs by using parameters in an INSERT statement.
1. prepare INSERT INTO myTable (blobField) VALUES(?)
2. do whatever I need to load the contents of a file into a Perl scalar.
3. execute the prepared statement with the Perl scalar as a parameter.
-- is there an ENV or mysql var to tell the engine where to find files
you want to load? mysql looks in ~ by default and i know i can use a
full path but it is reather long and cumbersome.


Relative paths are relative to the MySQL data directory, according to
the documentation (http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html).
There doesn't seem to be an option for an alternate home.

Regards,
Bill K.
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8642
by: David Sharp | last post by:
I've been doing some experiments with speeding up copying tables of approximately 1 million rows between databases using BCP and BULK INSERT. I noticed that the total time for removing the...
2
16490
by: php newbie | last post by:
Hello, I am trying to load a simple tab-delimited data file to SQL Server. I created a format file to go with it, since the data file differs from the destination table in number of columns. ...
20
8536
by: akej via SQLMonster.com | last post by:
Hi, i have table with 15 columns CREATE TABLE . ( PRIMARY KEY , NULL , NULL , NULL , NULL , (50) NULL , NULL
3
33212
by: moonriver | last post by:
Right now I develop an application to retrieve over 30,000 records from a binary file and then load them into a SQL Server DB. So far I load those records one by one, but the performance is very...
2
2577
by: Andy Hunt | last post by:
Hi, I am having a problem with SQLXML Bulk Load inside of a web service ( also inside of a basic aspx page). I have a WebMethod in a web service that makes a call to bulk load. This works...
5
2857
by: Sumanth | last post by:
Hi, I am running into a problem ( only in this particular instance). I insert one row into a table - takes a fraction of a second try to do a bulk load of the same --takes 10 seconds. ...
11
28283
by: Ted | last post by:
OK, I tried this: USE Alert_db; BULK INSERT funds FROM 'C:\\data\\myData.dat' WITH (FIELDTERMINATOR='\t', KEEPNULLS, ROWTERMINATOR='\r\n');
2
15096
by: nano | last post by:
Does sql server have a way to handle errors in a sproc which would allow one to insert rows, ignoring rows which would create a duplicate key violation? I know if one loops one can handle the error...
5
6823
by: yeoj13 | last post by:
Hello, I have a db2load script I'm using to populate a large table. Ideally, my target table is required to have "Not Null" constraints on a number of different columns. I've noticed a ...
1
3005
by: Ted | last post by:
I found this quite interesting. However, it seems to assume I have a schema defined in an xsd or xdr file. I get a data feed that appears to be well formed XML, but there is no schema. Is it...
0
7251
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7148
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5072
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
451
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.