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.
Limitations
Run the statements in this topic on the MaxCompute client (odpscmd). The USE statement is a CMD statement and runs only on the MaxCompute client.
Usage notes
-
A project is not a workspace. To get a project name, log on to the MaxCompute console and find the name in the MaxCompute MaxCompute consoleProject Name column on the Project management tab.
-
You cannot create or delete projects using statements in MaxCompute. To create a project, see Create a MaxCompute project.
Syntax
-- Go to a project.
use <project_name>;
Parameters
project_name: The name of the project to switch to. If the project does not exist or you do not have access permissions on it, an error is returned.
Examples
-
Example 1: Switch to a project and query a table in it.
-- The current project is my_project. Switch to my_project_test. odps@ my_project>use my_project_test; -- Query the test_src table in my_project_test. odps@ my_project_test>select * from test_src;MaxCompute searches for
test_srcinmy_project_test. If the table exists, the query returns data. If not, an error is returned. -
Example 2: Access a table in another project using its fully qualified name.
-- Access test_src in my_project2 from my_project_test. Grant permissions on the object before running this query. odps@ my_project_test>select * from my_project2.test_src;
Related statements
-
ADD ACCOUNTPROVIDER: Adds the RAM account system for a project.
-
SET PROJECT: Views or sets project properties.
-
LIST ACCOUNTPROVIDERS: Views the account systems supported by a project.
-
REMOVE ACCOUNTPROVIDER: Removes an account system from a project.