My file is not being created in the mapped drive when I try to create it using progress 4gl - openedge

I mapped a drive and tried to generate a text file through progress 4gl in that mapped drive. But file was not generated in that mapped drive. When I tried to generate the same file in a local drive then it was generated successfully. Can someone help me with this problem?
I have attached the Progress 4gl code to generate text file
this code has the location of local drive
procedure p-text-generation:
output to value ("//10.0.0.29/myfolder/abhinit.txt").
put unformatted
space(1) "hello from p-text-generation" skip.
output close.
END PROCEDURE. /* p-text-generation */
this code has the location of mapped drive
procedure p-text-generation:
output to value ("T:/abhinit.txt").
put unformatted
space(1) "hello from p-text-generation" skip.
output close.
END PROCEDURE. /* p-text-generation */
Both the logics are running in Appserver.
Without Appserver the mapped path is working fine
The folder myfolder is mapped as T drive in my system

Try setting your path as this:
(I'm currently using this way on Windows Server)
OUTPUT TO VALUE("t:\abhinit.txt").

Mapped Drives only work if you are running directly from prowin.exe or prowin32.exe. When running on an appserver, drives aren't mapped and the UNC permission is taken from the user running the progress service in windows

Related

Azure Databricks: How do we access R Scripts present on DBFS?

I'm new to DataBricks. I am trying to access a .R file that is present in the DBFS storage but I cannot figure out how to do so. Any help is really appreciated.
I can read data from the storage using the file path /dbfs and also source code from the script but I want to make edits to the script.
You need some editor to do that - for example, you can setup RStudio on your cluster and connect to it via RStudio UI - in this case you can edit R files directly on DBFS.
But really, the simplest for you would be to use Databricks CLI fs command to copy the file to your local machine, make changes in the editor of your choice, and upload file back.

Copying a file to sharepoint through SAS unix

As a part of my work I need to create few reports in SAS and export them to sharepoint site. I am trying to automate this process as shown below.
call system ("cp -p file.xls https//sharepointsite/folder1/file.xls");
when i run this code, it is not giving any error in the code but the file not uploaded into sharepoint.
Could anyone suggest me the solution for this case.
Try the following in order to extract any errors into your log
data _null_;
infile "cp -p file.xls https//sharepointsite/folder1/file.xls" pipe;
input;
list;
run;
You can also try running the command directly from your SAS server, as a shell command. If that is successful, the above should be succesful (although I wasn't aware that uploading files to sharepoint was that straightforward).
Edit: from reading around, I think it IS possible, you just need to have your sharepoint location mapped to a local directory, and to have contributor rights on the site itself. In which case make sure you use the 'local' path for the URL..

Mapping the oracle database directory object to a network path

I'm an accidental DBA. We have oracle database running on windows server.
I created an oracle directory object named 'Result' and mapped it one of the local drives (C:\appResult) on the database server. The front end application creates a report and writes the file to 'Result' and a file thus gets written to C:\appResult. Now, we want to change the file path 'C:\appResult' to some other server in the network (another server in the network). What is the best way to achieve this?
Use the CREATE OR REPLACE DIRECTORY... variant of this command:
CREATE OR REPLACE DIRECTORY RESULT AS '\\ServerName\ShareName\SomeOtherDir'
Share and enjoy.

Creat .BAT to copy a .mdb from network drive to local C:/

I hope I can get some help with this from someone here on this awesome website.
Im a complete noob when it comes to writing batch scripts and I would really like some help.
My situation..
I currently have a network drive on a PC running Windows Server 2008. The drive letter is I:/
within the I-drive, I have a folder named aaaaeast and within that folder is all of my .mdb's
I would like the .bat to copy a specific .mdb from I:/aaaaeast/ to a XP SP3 machine I have in the other room on startup.
Ive tried
copy \myserver\myshare\myfolder\myfile.txt c:\myfiles
But it fails to find the network path.
I know this is got to be a permission issue. My network doesnt have a domain and all the PC's I map to the I:/ map through the Guest account on the Win 2008 server using (username: Guest with no password)
Can someone please help or point me in the right direction.
Ok, this works for me where I work. There is a mapped drive to the location where the master .mdb is.
That is "i:\" drive.
copy i:\ets\lead\software\paint\leadmain.mdb c:\paint
it copies the .mdb to the "c:\paint" drive on the computer where the client clicked on the .bat file. It has been a while so I can't remember where the .bat file sits. Pretty sure it is on the client's computer.
Open Notepad, add the code above, and save making sure to pick the option "All files" down below. That way you can change the extension to .bat from .txt.
copy \\myserver\myshare\myfolder\myfile.txt c:\myfiles
Note: double-backslash
A UNC path (path to a network resource) requires that the target computer name be preceded by two backslashes. Otherwise, starting with \ means "start at the root of the current drive". (Perhaps this was just a typo in the post—that wouldn't cause an error 53.)
Regarding accounts, Windows doesn't really like no-password accounts. There are times when it won't let authentication succeed for a null password. You might try creating an account (with the same name as the username/password on the XP machine) on the 2008 machine and trying it just to see if the user has access to the share. A simple test of that would be something like "dir \myserver\myshare".
If you didn't want to sync accounts, you could create a third user on the 2008 machine and map the share (from the XP machine) as that user. You can also tell Windows to remember the credentials it used for that mapping if you wanted to (i.e. for convenience, definitely not security).

Where is SQLite database stored on disk?

Where is the SQLite database stored i.e. directory path on windows 7 when created ?
A SQLite database is a regular file. It is created in your script current directory.
.databases
If you run this command inside SQLite
.databases
it lists the path of all currently connected databases. Sample output:
seq name file
--- --------------- ----------------------------------------------------------
0 main /home/me/a.db
There is no "standard place" for a sqlite database. The file's location is specified to the library, and may be in your home directory, in the invoking program's folder, or any other place.
If it helps, sqlite databases are, by convention, named with a .db file extension.
If you are running Rails (its the default db in Rails) check the {RAILS_ROOT}/config/database.yml file and you will see something like:
database: db/development.sqlite3
This means that it will be in the {RAILS_ROOT}/db directory.
When you call sqlite3_open() you specify the filepath the database is opened from/saved to, if it is not an absolute path it is specified relative to your current working directory.
It depends on how you initialized the database. If you used the command line shell for SQLite (e.g. sqlite3 ex1) to create the database, it'll be a path from the root of your local machine. If you used a Python script to create the database, it'll be a path from your project.
To check the former, run the command line shell:
sqlite3
sqlite> .databases
To check the path in your project, you can print the path in the connection. For example:
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DATABASE = 'db'
def get_db_connection():
print(os.path.join(BASE_DIR, DATABASE, "database.db"))
conn = sqlite3.connect(os.path.join(BASE_DIR, DATABASE, "database.db"))
conn.row_factory = sqlite3.Row
return conn
In my case I think it was an access issue. I saved the SQLite files to "C:/Program Files (x86)/sqlite". I CD'd there, ran sqlite3, and created a database called test.db:
As you can see, I ran .database, which told me the .db file was created in the same directory, so I went to confirm in File Explorer, and it wasn't there:
Curiously the database was working correctly in spite of this.
It was only through trial-and-error that I discovered that I could save in some locations, but not others. It appears to me that SQLite can't save to locations that require elevation. In my case, moving from Program Files to My Documents made the issue go away.
I find it quite irritating that SQLite doesn't just tell me "access denied" instead of trying to be clever and saving to some location that I can't even find.
In Windows machines (Windows 2010), by default, the new SQLite database files will be stored in the same folder where Sqlite3.EXE application is stored in your machine. However , we can create a new folder in Windows and within sqlite> prompt, you may use the .cd to change to the new working directory.
It is a good idea to give a .db file extension to the new database files that you create (even though it is not mandatory to have any file extension)
The SQLite command, .databases will show the default database "main" or currently created or currently opened database or all "attached" database files with file path. The .attach is useful to attach more than one database file to the current connection when we want to work with tables belonging to different databases.
Regards,
Biju Joseph N.,
Houston TX, USA (January 12, 2023)
the database path will be displayed, when using .databases
SQLite is created in your python directory where you installed the python.
SQLit Database is simply a file where your local data is stored on your local machine
In Windows 10 if in the prompt command the path where you start sqlite is
C:\users\USER_NAME
You can find it in the user home folder.
The .db file is stored where you start the sqlite command.
I hope this solve the issue

Resources