How to retrieve the name from the Oracle table?
In Oracle 11G and higher versions, you can use the table to get the name of the table owned by the current user. For tables owned by all users, use
or table. USER_TAB_COLS
ALL_TAB_COLS
Example query DBA_TAB_COLS
To exclude some columns and the specified mode of the 'users' table, you can use the following inquiries:
Note:Table names and columns are usually represented in an uppercase form in Oracle. Please make sure that your inquiries are also used in capital.
<code class="language-sql">SELECT column_name FROM all_tab_cols WHERE table_name = 'USERS' AND owner = '<schema_name>' AND column_name NOT IN ('PASSWORD', 'VERSION', 'ID')</code>
In Oracle, the table space and mode are not the same. The table space refers to the physical storage location of the table, and the pattern is the logical group of the database object owned by the user or the character. Therefore, you don't need to specify the table space name in the query.
The general HQL equivalent effect
The above Oracle query does not have direct HQL equivalent items. However, you can useand
annotations in JPA to specify the pattern and columns to be eliminated.The above is the detailed content of How Do I Retrieve Column Names from an Oracle Table?. For more information, please follow other related articles on the PHP Chinese website!