I'm trying to obtain the full path of the server's desktop using a plsql script. running the script on the server itself.
There seems to be no methods inside plsql to retrieve it. I need to spool the output of my script to the desktop no matter on which computer/server. So the username and desktop path can be different on other machines.
EDIT: Currently trying: dbms_system.get_env('userprofile', desktop);
I can get the path of the desktop but it is not the current user's one. What i get is C:\Documents and Settings\Default User\Desktop
Also have tried: SQL> host echo %username%
Administrator
Ultimately the path i n开发者_如何学Pythoneed is i.e. C:\Documents and Settings\Administrator\Desktop but the username cannot be hardcoded...
Generally a server can't write directly to a client's desktop / filesystem. The client software requests a stream of data from the server and then the client may write it to the screen, a file....
If the client software isn't being co-operative, I'd look at emailing the results to the user.
[You can get the OS_USER and IP of the client using SYS_CONTEXT and USERENV, but that probably isn't useful, and definitely not if they have come through an app-server.]
精彩评论