View Single Post
Old 07-14-2018, 12:17 PM   #36
MajP
Newly Registered User
 
Join Date: May 2018
Location: USA baby
Posts: 1,888
Thanks: 38
Thanked 571 Times in 538 Posts
MajP has a spectacular aura about MajP has a spectacular aura about
Re: Help with text file trim and create 2 tables

Quote:
if i need to add any more lines similar to below, which line do i amend.
This is why I suggested that these "reasons" be put in a single table as stored below. Then a single line of code would suffice to update additional reaons.

Code:
ReasonType      ReasonDescription RunID
Exception          xxxxxxx                             3
Rej Reason        y1234                                3
Warning            aba                                    3
Already Carved  Instant XXX granted for Insxxxxxxx   3
The reasons would relate back to where they came from. I am not sure what that block of information is called. I called them runs. But it is that block of stuff that has an S_no, and instrument number, and amount. Example of multiple reasons relating back
Code:
 1                 10            2,000.00     Error :      C. I. DR TRAN TO DORMANT
                                              Warning :    Instrument already entered through ICTM
					      Exception :  Ixxxxxxxxxxx Axxxx BAL EXCP
					      Instrument Rejected
If the table was done that way, adding an additional reason would be easy. Currently each reason is a field in the table, so you have to modify the table and modify the insert query every time you find a new reason. You have to be very precise to get this all correct. With the other suggested approach you could have hundreds of reason and only have to update some of the code to find the reason. If you are absolutely confident this is the only other "reason" I recommend you send me an example so I can test it. You have to update the table, code, and insert query. If you think the future could be more reasons, I recommend modify the table as I said. Then it would be a single line of code versus a table and insert query change.

The above is doable either way. For the second part "It is the existing reason, but the line continues on the second line", that gets really tough. The question is, if there is some kind of rule to apply. If someone was to read this line "Axxxxxx Cxxxxx" manually how would they know it belongs to the previous line? Is there some indicator. There are other values that do not follow a colon such as "Instrument Rejected".
MajP is online now   Reply With Quote
The Following User Says Thank You to MajP For This Useful Post:
lookforsmt (07-15-2018)