Question "OUTPUT TO" -> path of location where the file needs to be saved is on a different server

VincentS

New Member
Hi guys,

I've been working with the query below and it worked fine since both the database and the location where the file needed to be saved were on the same server:

OUTPUT TO /export/filename.txt.
PUT UNFORMATTED
"Columnname" CHR(9).
PUT SKIP.
FOR EACH tablename NO-LOCK :
PUT UNFORMATTED
Value CHR(9).
PUT SKIP.
END.

Recently, our servers have been upgraded and the file should be saved on a different location (different server than the one the database is on). If I understood correctly, the database is on a Linux server while the file should be saved an a Windows server. I would suspect that I need to add "login" details somewhere in the "OUTPUT TO" line, but I couldn't find the correct syntax in my numerous searches online. (I am a complete noob in Progress, have same basic knowledge of databases, mainly MySQL - self taught). I do not have direct access to the database I'm querying above and I cannot see "error" statements. This code is put into a .p file and is picked up by our ERP system. That makes it very hard for a noob like me to see exactly where the problem is situated. (I have also reached out to our ERP supplier, but chances are they will only reply somewhere next year or so... and I'd like to get this moving asap :))

If anyone could help me on this, it would be extremely appreciated!

Kind regards,

Vincent
 

Cringer

ProgressTalk.com Moderator
Staff member
Unless you have mounted the external drive on the Linux machine then you won't be able to write to it in a stream like that. And a word of warning - streaming to a network location can be slow. You may be better streaming to a local folder and then using an OS-COMMAND to copy the file to the final destination once it's done.
 

VincentS

New Member
Unless you have mounted the external drive on the Linux machine then you won't be able to write to it in a stream like that. And a word of warning - streaming to a network location can be slow. You may be better streaming to a local folder and then using an OS-COMMAND to copy the file to the final destination once it's done.
Thanks for your quick reply!

Creating a task to copy the file was indeed an alternative I was contemplating, but since it's a lot of data it seemed an inefficient way to handle this :) I understand from your reply that this will be the only way to get it done for now.

Thanks for that!

Grtz,

Vincent
 
Hello
I second @Cringer, and more if it is a lot of data: this will take some time and you could have a (even small) network outage in the middle.
It would be more robust to generate it locally, then copy it over.
If something fails later on, it will be easier to see where the problem is coming from.
Anyway, do you have a Windows share mounted locally on the Linux machine? In any case you will need a way to copy the file to the remote location (OS-COMMAND only supports paths valid for the operating system, no URL), so mounting a remote directory could be one solution.
++
JC
 

VincentS

New Member
Hello
I second @Cringer, and more if it is a lot of data: this will take some time and you could have a (even small) network outage in the middle.
It would be more robust to generate it locally, then copy it over.
If something fails later on, it will be easier to see where the problem is coming from.
Anyway, do you have a Windows share mounted locally on the Linux machine? In any case you will need a way to copy the file to the remote location (OS-COMMAND only supports paths valid for the operating system, no URL), so mounting a remote directory could be one solution.
++
JC
Hi,

Thanks for your reply on this subject and your confirmation of the above!

I'm convinced now that the best way forward for me is to just copy the files to the new servers using a task. I'll certainly pass on your feedback to our IT-guys for a more efficient way in the future! (I myself am more of a financial profile with interest in IT :))

I'll try to see if I can close this topic ;)

Grtz,

Vincent
 

dimitri.p

Member
"I'm convinced now that the best way forward for me is to just copy the files to the new servers using a task. I'll certainly pass on your feedback to our IT-guys for a more efficient way in the future!"

Upgrade the IT guys next.
 
Top