Want to know query to list all tables in oracle database? we have a huge selection of query to list all tables in oracle database information on alibabacloud.com
2.1 obtain the names of all tables in the database.
Sample Data:
Statement:
Select T. Name 'table name' from sysobjects t where objectproperty (T. ID,N 'isusertable') = 1
Or use select name from sysobjects where type = 'U'
Execution result:
2.2 obtain the names of all fields in al
Tags: nullable data The Precision database SYS returns to CAS serverThe code looks like this:/*********************************sqlserver queries All tables in the database and their field properties *********************************/SELECT( Case whenA.colorder= 1 ThenD.nameELSE "' END) asTable name,--returns
Database Structure Description
The database uses MySQL, 78 tables in total
Ecs_account_log: account change log (registered user recharge, payment, and other records)
Ecs_ad: advertisement table
Ecs_admin_action: Administrator permission table (128 function operations are defined)
Ecs_admin_log: Administrator operation log table
Ecs_admin_message: Administrator me
In some cases, you must update all tables with a specific field in the database. For example: update all data in a system belonging to Company A as belonging to Company B. If you manually change a table to a table, it will be a waste of time and mechanical repetition. In addition, if you are not familiar with the syste
In fact, we only use the show usage in the mysql tutorial. The simple operation in mysql is as follows:
Show table
In this way, all the tables are displayed, but they are different in the php tutorial. Let's look at the following code:
$ Server = 'localhost ';
$ User = 'root ';
$ Pass = '';
$ Dbname = 'dayanmei _ com ';
$ Conn = mysql_connect ($ server, $ user, $ pass );
If (! $ Conn) die ("
-- SQL creates a primary key for all user data tables in the database-- Primary key Description: The name is ID, and the data type is Integer auto-increment.
-- Query all constraints of the current database before creationSelect
How does Oracle search for fields with a value in all tables under the current user?Create or replace procedure My_pro_searchkeyword isV_sql VARCHAR2 (4000);V_tb_column VARCHAR2 (4000);V_CNT number (18,0);Cursor cur is select ' Select ' | | ' "' | | t1.table_name| | ' "." ' | | T1. column_name| | ' ' | | ', ' | | ' as COL_NAME, NVL (COUNT (t. "' | | T1. column_na
Oracle Database Console (Oracle Enterprise Manager Console ).The TableName statement is as follows:SELECT field name FROM TableName @ Data Link name;
Copy table data:
Insert into Table Name (field name) (SELECT field name FROM TableName @ Data Link name );
View DBLINK:
Select owner, db_link from dba_db_links;
Delete:
Drop d
-- SQL deletes the Foreign keys of all user data tables in the database
-- Query all constraints of the current database before deletionSelect * From information_schema.key_column_usage
Declare @ tablename nvarchar (250)-- Declare
To meet a requirement, you need to modify all the tables in the database that contain the email fields, and change the length of the inside to 128 bits. Laravel gets all the tables and then loops through the table to see if there is any email in this field. The code is as fo
party)))'
The Data Link name is the service name of the Tree node added to the local Oracle Database Console (Oracle Enterprise Manager Console ).The TableName statement is as follows:SELECT field name FROM TableName @ Data Link name;
Copy table data:
Insert into Table Name (field name) (SELECT field name FROM TableName @ Data Link name );
View DBLINK:
Select ow
In fact, it is not complicated to delete the data in the database. Why should I delete all the data in the database? First, I will introduce how to delete all the data in the database, because the data may form a constrained relationship between each other, the delete operat
,COLUMN_NAME,DATA_TYPE,DATA_LENGTH,DATA_PRECISION,DATA_SCALE,NULLABLE,COLUMN_ID, etc.Get Table Comments:SELECT * FROM user_tab_commentsUser_tab_comments:table_name,table_type,commentsThe corresponding dba_tab_comments,all_tab_comments, the two more than the User_tab_comments ower column. Get field Comments:SELECT * FROM user_col_commentsUser_col_comments:table_name,column_name,commentsThe corresponding dba_col_comments,all_col_comments, the two more than the User_col_comments ower column. For ex
The PHP code for getting all tables in a MySQL database is as follows. For more information, see.
The PHP code for getting all tables in a MySQL database is as follows. For more information, see.
The Code is as follows:
Funct
IF object_id (N ' usp_queryalltablefieldcontent ') is not nullbegindrop PROC usp_queryalltablefieldcontentendgocreate PROCEDURE usp_queryalltablefieldcontent (@queryFieldType VARCHAR (max),--type to query @queryContent VA Rchar (max),--the content to query @queryFieldName VARCHAR (max) = "--the field name to query) as begin--CREATE table name from the
.
@ Test public void export () throws Exception {// declare the database to be exported String dbName = "focus"; // declare book HSSFWorkbook book = new HSSFWorkbook (); // obtain the Connection and obtain the metadata of the database. Connection con = ceceutils. getConn (); // declare statemen Statement st = con. createStatement (); // st.exe cute ("use" + dbName); DatabaseMetaData dmd = con. getMetaData (
Provides various official and user-released code examples. For code reference, you are welcome to learn thinkphp3.2 and use PHPExcel to export the structure of all tables in the database, including annotations.
First look at the figure
I. The controller code is as follows:
Public function out (){$ SQL = "show tables"
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.