Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
shifis
Posting Yak Master
157 Posts |
Posted - 2006-03-01 : 13:05:55
|
| Hi!I need to do a program something like a credit or debit card process.They will live me a txt file in one directory with the information of the client ID and the amount to be charge.I have to return in another text file the autorization or denied of the transaction.And finally I have to update the balance client if everything goes ok.The problem here is that I don't have any idea about how to read this txt files that they will put in some folder and do the transaction with sqlserver data base.I don't know what is the best way to pass and return the txt file ( if exist a special txt format to do the transaction faster) to the server.Any help will be very wellcome.That for your time. |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-03-01 : 13:13:52
|
write an app that reads and writes the text file and also communicates with the sql server.Go with the flow & have fun! Else fight the flow |
 |
|
|
JoeNak
Constraint Violating Yak Guru
292 Posts |
Posted - 2006-03-01 : 14:11:28
|
Probably a little more complicated than your description, shifis.quote: The problem here is that I don't have any idea about how to read this txt files
Whoever is providing the files should also provide a file layout.Should be simple enough to write an app or DTS to parse the text. |
 |
|
|
shifis
Posting Yak Master
157 Posts |
Posted - 2006-03-01 : 14:15:43
|
| I mean I have a lot of ideas but I don't have any that makes me feel that I am going to the right place.I ones do a DTS that read a txt file and export the information to a table, but I don't know how to do a DTS that read a file that maybe doesn't have the same name, and because we have like 30 stores we will going to have a lot of txt at the same time, this is the part that I don't get it, how will I do a DTS that process files with diferent name and generate the returns too.I am confuse has you can see.This is the flow1.POS --->2.PC---->3.DB5.POS<---4.PC<----1.The poin of sale will read the card, generate a txt with the basic information, the amount of the transaccion and the ID of the card.2.The txt is copy to another PC, and this PC copy the txt to the sqlserver database computer.3.In some way the sqlserver computer have to detect the txt file, read the information, generate another txt with the answer, and if the transaccion have sucess update the client balance.4.The server have to return the txt to the PC5. The PC have to return the txt to the POS.If you are question why the PC is because the POS doesn't have windows , so that is why we need the PC with windows to comunicate with the central server that will have the information of the data base. |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-03-01 : 14:26:48
|
1. you need to write a port listener. not a web port but a pc port. serial, parallel, usb, ... the kind that your POS has.2. when data comes you process steps 2, 3, 43. send the data back to POSGo with the flow & have fun! Else fight the flow |
 |
|
|
JoeNak
Constraint Violating Yak Guru
292 Posts |
Posted - 2006-03-01 : 14:28:10
|
| I'm guessing you're going to get multiple files at different times. Your best bet is going to be to write an app/windows service/etc..) to listen for the files, then read them into SQL server. Ideally this app should not be on the SQL Server. |
 |
|
|
|
|
|
|
|