USE
Goes to a specific project on which you have access permissions. After you go to the project, you can manage all objects in the project.
Limits
Run the command in this topic in the MaxCompute client. This command is a CMD command and can be run only in the odpscmd client.
Notes
-
A project is not a workspace. To obtain the project name, log on to the MaxCompute console, select Workspace > Projects. On the Projects page, the project name appears in the MaxCompute Project Name column.
-
MaxCompute does not provide commands to create or delete projects. For more information, see Create a MaxCompute project.
Syntax
-- Go to a project.
use <project_name>;Parameters
project_name: the name of the project to which you want to go. If the project does not exist or you do not have access permissions on the project, an error is returned.
Examples
Example 1: Go to a specific project and access the objects in the project.
-- The current project is my_project, and the project that you want to go to is my_project_test. You have access permissions on the my_project_test project. odps@ my_project>use my_project_test; -- After you go to the my_project_test project, you can perform other operations. For example, query the test_src table in the my_project_test project. odps@ my_project_test>select * from test_src;MaxCompute searches for the test_src table in the my_project_test project. If the table exists, data in the table is returned. If the table does not exist, an error is returned.
Example 2: To access an object in a project from another project, grant permissions on the object and specify the name of the project to which the object belongs.
-- Access the test_src table in the my_project2 project from the my_project_test project. odps@ my_project_test>select * from my_project2.test_src;
Related statements
ADD ACCOUNTPROVIDER: Adds the RAM account system for a project.
SETPROJECT: Views or sets project properties.
LIST ACCOUNTPROVIDERS: Views the information of the account systems supported by a project.
REMOVE ACCOUNTPROVIDER: Deletes the information of the account systems supported by a project.