Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: updating records into RDBMS from a text file

by Abigail (Deacon)
on Jul 12, 2001 at 16:13 UTC ( [id://95997]=note: print w/replies, xml ) Need Help??


in reply to updating records into RDBMS from a text file

Well, what the fastest way is depends on the format of your text file, the structure of your tables, the number records already in the table, the number of records in the file, the number of indices on the table, the number of expected locks during your actions, and of course, the RDBMS itself. Some databases can read straight from a text file, if it has the appropriate format. Other can't, or can't with your format.

There are too many unknown factors to answer your question. But even if you gave me the factors, I would hesitate to answer; it sounds too much like you're trying to get people do your work. What have you done yourself so far?

-- Abigail

  • Comment on Re: updating records into RDBMS from a text file

Replies are listed 'Best First'.
Re: Re: updating records into RDBMS from a text file
by Anonymous Monk on Jul 13, 2001 at 10:07 UTC
    Sorry for being too cryptic! Till now what I have done is:
    I am reading the delimited text file and am taking each line into an array
    I have constructed the SQL statement (Update table..) and again put it into an array
    as the Update statements will have to be executed one at a time right? What I would like help on is the interaction with the RDBMS like
    opening database connection and then actually executing the Update commands that I have constructed put into the array
    I can't use the RDBMS utilities to read the text file but I want the external utility (that I am building) to do it.
    Thanks once again!
    Joe
      Well, it looks like you have no experience with connecting to a database from without Perl. Luckely, there are various modules that do a lot of work for you. You should check out the DBI module, and a DBD driver for the RDBMS you work with. DBI is a generic interface, giving the same interface to many different database servers. There are also packages for specific databases, which will give you more features - but you lose in portability. Take your pick ;-)

      -- Abigail

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://95997]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-25 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found