Table column name is more time, manual write column name is more troublesome, this function can let a person secretly lazyCreate or Replace function F_getcols (p_tablename in varchar2/* gets all column names in the table before and after you add
CREATE TABLE as SELECT * FROM and insert to select from two table copy statement differences[SQL]View PlainCopy
Create table targer_table as select * from source_table
INSERT INTO target_table (column1,column2) select Column1,column2
Gets the primary key column name of the table SQLSELECT * FROM User_cons_columnswhere constraint_name = (select Constraint_name from user_constraintsWHERE table_name = ' bst_favorite ' and constraint_type = ' P ');Remember : table names are
Management of 1.Oracle Tables
Naming conventions for table and column names:
Must start with a letter;
Length cannot exceed 30 characters;
Cannot use Oracle's reserved words;
Use only the following characters: A-Z, A-Z, 0-9,
Oracle displays the user's table names, Table Comments, field names, field comments, whether it is empty, field type, and oracle fields.
-- Oracle: view all the table names, Table Comments, field names, field comments of the user, whether the table
Oracle lists all the table names. The column name takes one day. there may be better methods. test environment: oracle xe 11g 1 shows all table names: select table_name from user_tables; 2 shows all column names: select OWNER, TABLE_NAME,
Note: The name of the table you want to query is capitalized. For example: ' USER '1. Find all indexes of the table (including index name, type, constituent column):Select T.*,i.index_type from User_ind_columns t,user_indexes i where t.index_name =
--Most of the dba/all/user/v_$/gv_$/session/index starts with a view-Dba_tables means all the relational tables that the DBA has or can access.--All_tables All relational tables that a user has or can access.-User_tables means all the relational
1. Find all indexes of the table (including index name, type, constituent column):Select T.*,i.index_type from User_ind_columns t,user_indexes i where t.index_name = i.index_name and t.table_name = I.tabl E_name and t.table_name = table to query2.
ORACLE cannot use variables as column names and table names some of the individual validations are:1 DECLARE2Ename1 Emp.ename%TYPE;3TYPE Index_emp_type is TABLE of VARCHAR2( -)INDEX byPls_integer;4 index_emp Index_emp_type;5 BEGIN 6Index_emp (1) :=
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.