Answer by DSH for How can I get column names from a table in Oracle?
This will return all tables:SELECT table_name, column_name, data_type, data_lengthFROM ALL_TAB_COLUMNSWHERE TABLE_NAME = 'YOUR_TABLE_NAME'
View ArticleAnswer by Renaud Kern for How can I get column names from a table in Oracle?
In Oracle, there is two views that describe columns:DBA_TAB_COLUMNS describes the columns of all tables, views, andclusters in the database.USER_TAB_COLUMNS describes the columns of the tables, views,...
View ArticleAnswer by user3655399 for How can I get column names from a table in Oracle?
SELECT COLUMN_NAME FROM YourDatabase.INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'YourTableName'
View ArticleAnswer by Etibar - a tea bar for How can I get column names from a table in...
you can run this querySELECT t.name AS table_name,SCHEMA_NAME(schema_id) AS schema_name,c.name AS column_nameFROM sys.tables AS tINNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_IDWHERE c.name LIKE...
View ArticleAnswer by Dbo for How can I get column names from a table in Oracle?
MysqlSHOW COLUMNS FROM a_table_named_users WHERE Field REGEXP 'user_id|user_name|user_pass'This will return a result something like this:Field | Type | Null | Key | Default | Extra user_id int(8) NO...
View ArticleAnswer by pals17 for How can I get column names from a table in Oracle?
Try thisselect * from sys.all_columns c join sys.objects o on c.object_id=o.object_id where o.name = 'TABLENAME' and c.name like '%COLUMN NAME%'
View ArticleAnswer by carnust for How can I get column names from a table in Oracle?
Came across this question looking for access to column names on Teradata, so I'll add the answer for their 'flavour' of SQL:SELECT ColumnNameFROM DBC.ColumnsWHERE DatabaseName='DBASE_NAME'AND...
View ArticleAnswer by expert one for How can I get column names from a table in Oracle?
SELECT COLUMN_NAME 'all_columns'FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='user';
View ArticleAnswer by blue-sky for How can I get column names from a table in Oracle?
Just select first row from the table , for oracle : select * from <table name> where rownum = 1;
View ArticleAnswer by Jaisankar for How can I get column names from a table in Oracle?
Even this is also one of the way we can use itselect * from product where 1 != 1
View ArticleAnswer by Henry for How can I get column names from a table in Oracle?
SELECT A.COLUMN_NAME, A.* FROM all_tab_columns a WHERE table_name = 'Your Table Name'AND A.COLUMN_NAME = 'COLUMN NAME' AND a.owner = 'Schema'
View ArticleAnswer by Val for How can I get column names from a table in Oracle?
I did it like thisSELECT TOP 0 *FROM PostsIt works even in http://data.stackexchange.com whose service tables I am not aware of!
View ArticleAnswer by user2558588 for How can I get column names from a table in Oracle?
The answer is here: http://php.net/manual/en/function.mysql-list-fields.phpI'd use the following code in your case:$result = mysql_query("SHOW COLUMNS FROM sometable");if (!$result) { echo 'Could not...
View ArticleAnswer by shieldstroy for How can I get column names from a table in Oracle?
For SQLite I believe you can use something like the following: PRAGMA table_info(table-name);Explanation from sqlite.org:This pragma returns one row for each column in the named table. Columns in the...
View ArticleAnswer by bstricks for How can I get column names from a table in Oracle?
For SQL Server:SELECT [name] AS [Column Name]FROM syscolumnsWHERE id = object_id('TABLE_NAME')
View ArticleAnswer by Rohit for How can I get column names from a table in Oracle?
describe YOUR_TABLE;In your case :describe EVENT_LOG;
View ArticleAnswer by jampez77 for How can I get column names from a table in Oracle?
For OracleSELECT column_name FROM user_tab_cols WHERE table_name=UPPER('tableName');
View ArticleAnswer by ssamuel68 for How can I get column names from a table in Oracle?
For MySQL, use SELECT column_name FROM information_schema.columns WHERE table_schema = 'Schema' AND table_name = 'Table_Name'
View ArticleAnswer by WEFX for How can I get column names from a table in Oracle?
You could also try this, but it might be more information than you need:sp_columns TABLE_NAME
View ArticleAnswer by user1464296 for How can I get column names from a table in Oracle?
select column_name,* from information_schema.columns where table_name = 'YourTableName'order by ordinal_position
View ArticleAnswer by Jom for How can I get column names from a table in Oracle?
For SQL Server 2008, we can use information_schema.columns for getting column informationSELECT *FROM information_schema.columnsWHERE table_name = 'Table_Name'ORDER BY ordinal_position
View ArticleAnswer by Eppz for How can I get column names from a table in Oracle?
In SQL Server...SELECT [name] AS [Column Name]FROM syscolumnsWHERE id = (SELECT id FROM sysobjects WHERE type = 'V' AND [Name] = 'Your table name')Type = 'V' for viewsType = 'U' for tables
View ArticleAnswer by Sasha for How can I get column names from a table in Oracle?
The other answers sufficiently answer the question, but I thought I would share some additional information. Others describe the "DESCRIBE table" syntax in order to get the table information. If you...
View ArticleAnswer by baretta for How can I get column names from a table in Oracle?
You can query the USER_TAB_COLUMNS table for table column metadata.SELECT table_name, column_name, data_type, data_lengthFROM USER_TAB_COLUMNSWHERE table_name = 'MYTABLE'
View ArticleAnswer by Jon Ericson for How can I get column names from a table in Oracle?
That information is stored in the ALL_TAB_COLUMNS system table:SQL> select column_name from all_tab_columns where table_name = 'DUAL';DUMMYOr you could DESCRIBE the table if you are using...
View ArticleAnswer by Sergey Golovchenko for How can I get column names from a table in...
You can do this:describe EVENT_LOGordesc EVENT_LOGNote: only applicable if you know the table name and specifically for Oracle.
View ArticleHow can I get column names from a table in Oracle?
I need to query the database to get the column names, not to be confused with data in the table. For example, if I have a table named EVENT_LOG that contains eventID, eventType, eventDesc, and...
View Article