[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: How to add datavalue into database from text file

  • Thread starter Thread starter rayherring
  • Start date Start date
Status
Not open for further replies.
R

rayherring

Guest
Yeah, you can read it into the DB, it's how I do it for our pricefiles from supplier CSV files. Inside the 'repeat' you just need to do a create record statement and then set some field values. Once you have created the record, you could 'release' the record and then do a 'find' statement on it (assuming you have enough info to find the record afterwards. To find the record afterwards you would have to know what record you just did, which means still having the variables (or at least some of them). For example: REPEAT: CREATE Owner. IMPORT DELIMITER ";" Owner.Name Owner.SurName Owner.Telefon Owner.E_mail. oname = Owner.Name. osurname = Owner.SurName. RELEASE Owner. FIND Owner NO-LOCK WHERE Owner.Name = oname AND Owner.SurName = osurname NO-ERROR. IF AVAIL ( Owner ) THEN DISPLAY Owner. END. Obviously I have made assumptions when it comes to the 'FIND' statement since I don't know how your indexes, etc... are set up. This is also a very rough and dirty way, ideally you would have buffers defined so that you aren't using the default table buffer that OpenEdge provides, and you would probably have more error checking (maybe make it a transaction so it all has to be read successfully from the text file or none of it goes in, etc...), but that should give you ideas to help.

Continue reading...
 
Status
Not open for further replies.
Back
Top