If these files you trying to rename are in some network directory find out do you have rights to rename files in this directory.
Main Topics
Browse All TopicsI'm not sure if this is the right TA but I'll give it a shot.
I'm using SQR (in a product called Brio) to read a text file and update a MSSQL database using the data in it. I've not used SQR before but the online help is quite good, and I'm getting by.
My program is working except for one thing. I would like to rename the input text file after successfully using it, to prevent it inadvertantly being processed again.
But I can't get the RENAME statement to work.
Here is my code:
if $errors = 'N' and $update = 'Y'
print 'No errors - update now proceeding ...' (+2,1)
do update-processing
print 'Updating complete - end of job' (+2,1)
let $newfilename = $filename || $systemdate
let $oldname-mess = 'old name ' || $filename
let $newname-mess = 'new name ' || $newfilename
print $oldname-mess (+2,1)
print $newname-mess (+2,1)
let #fstatus = rename($filename, $newfilename)
let $fstatus = #fstatus
let $status-mess = 'status ' || $fstatus
print $status-mess (+2,1)
end-if
It prints 'status 13.000000000000000', and the file does not get renamed.
I haven't been able to find out what status 13 means, and I don't know what I'm doing wrong.
Any ideas please?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thanks for your comments guys ...
arbert,
It's not just importing data, there's a lot of quite complex logic in the process, and we need some sort of procedural language to do it. SQR has been chosen and I have to live with it. Is there a different TA where I should post?
Erza,
Permissions. Good point. I personally have the right to rename this file, but I wonder if the Brio program does. Hmmm. Will investigate tomorrow. According to the Brio online manual the status 13 is returned from the operating system. I will see if there is a TA for Windows and try the question there.
Business Accounts
Answer for Membership
by: arbertPosted on 2003-12-16 at 22:12:19ID: 9955027
SQR isn't a part of SQL server, so you'll probably get limited response here....Since you're using SQL Server, you should really use something more appropriate to import the data like DTS or BCP. Brio is geared more for reporting....I think you'll find that you would code a LOT less with DTS as well....