Administrators can create directory access servers using the CREATE SERVER statement in Interactive SQL.
Prerequisites
You must have the SERVER OPERATOR and MANAGE ANY USER system privileges.
You must have the CREATE PROXY TABLE system privilege to create proxy tables owned by you. You must have the CREATE ANY TABLE or CREATE ANY OBJECT system privilege to create proxy tables owned by others.
Create a remote server by using the CREATE SERVER statement.
CREATE SERVER my_dir_server CLASS 'DIRECTORY' USING 'ROOT=c:\Program Files;SUBDIRS=3'; |
Create an external login by using the CREATE EXTERNLOGIN statement.
CREATE EXTERNLOGIN DBA TO my_dir_server; |
Create a proxy table for the directory by using the CREATE EXISTING TABLE statement.
CREATE EXISTING TABLE my_program_files AT 'my_dir_server;;;.'; |
In this example, my_program_files is the name of the proxy table, and my_dir_server is the name of the directory access server.
Display rows in the proxy table.
SELECT * FROM my_program_files ORDER BY file_name; |
Using the sp_remote_tables system procedure, you can see all the subdirectories located in c:\mydir on the computer running the database server:
CALL sp_remote_tables( 'my_dir_server' ); |
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0 |