Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

import Database 2

Status
Not open for further replies.

dontu

Programmer
Mar 17, 2006
14
RO
Hi all,
I want import a file in database and when i do that say me "DBI Error:Can't execute statement: File '\importaredb.txt' not found (Errcode: 2) at D:/Home/Romeo/Projects/alina.com/scripts/psql.pl line 113. "

where it must been this file save?
 
Can we see the script?

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 

sure :



use romeo;
select *from address;
LOAD DATA LOCAL INFILE '/importaredb.txt'
INTO TABLE address
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(orasul, strada, blocul);


regards,
dontu
 
What's "romeo"? That doesn't look like a perl script

--Paul

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
That looks like MySQL.

What the message is saying is that the file "/importaredb.txt" doesn't exist. Does it exist? Remember the word LOCAL says that the file is located on the client machine; if you remove LOCAL it must be on the MySQL server.
 
ok, but where on the client machine?
 
You must give the full path of the file, which would be something like "/home/dontu/importaredb.txt" or "c:/data/importaredb.txt" .
 
thank you TonyGroves
is strong boy,
best regards,
dontu
 
Can anyone answer the "use 'romeo'" bit?

--Paul

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
It's MySQL syntax, meaning that "romeo" becomes the default database for future SQL statements. It's a bit misleading posting this problem in the Perl forum.
 
gotcha

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top