I would like to know the SQL statement for displaying only the column
names of a particular table. For eg. if I have a table by the name
DETAILS and it has three columns FIRST_NAME, LAST_NAME and
DT_OF_BIRTH, using what SQL statement can I display only the column
names and not their content ? 4 83541
On May 24, 8:50 am, mailsu...@gmail.com wrote:
I would like to know the SQL statement for displaying only the column
names of a particular table. For eg. if I have a table by the name
DETAILS and it has three columns FIRST_NAME, LAST_NAME and
DT_OF_BIRTH, using what SQL statement can I display only the column
names and not their content ?
SELECT TABNAME,COLNAME from SYSCAT.COLUMNS where TABNAME='DETAILS'
On May 24, 2:19 pm, situ <SRIDHAR...@REDIFFMAIL.COMwrote:
On May 24, 8:50 am, mailsu...@gmail.com wrote:
I would like to know the SQL statement for displaying only the column
names of a particular table. For eg. if I have a table by the name
DETAILS and it has three columns FIRST_NAME, LAST_NAME and
DT_OF_BIRTH, using what SQL statement can I display only the column
names and not their content ?
SELECT TABNAME,COLNAME from SYSCAT.COLUMNS where TABNAME='DETAILS'
Thanks ! ma*******@gmail.com wrote:
On May 24, 2:19 pm, situ <SRIDHAR...@REDIFFMAIL.COMwrote:
>On May 24, 8:50 am, mailsu...@gmail.com wrote:
I would like to know the SQL statement for displaying only the column
names of a particular table. For eg. if I have a table by the name
DETAILS and it has three columns FIRST_NAME, LAST_NAME and
DT_OF_BIRTH, using what SQL statement can I display only the column
names and not their content ?
SELECT TABNAME,COLNAME from SYSCAT.COLUMNS where TABNAME='DETAILS'
In addition to situs answer, I you are running your query from a host
language such as java, a common trick is to select from the table with a
predicate that is always false, and then grab the metadata from the
resultset. I.e.
select * from DETAILS where 1=0
I'm not saying that this is better, only that it is another possability
/Lennart
Lennart wrote:
ma*******@gmail.com wrote:
>On May 24, 2:19 pm, situ <SRIDHAR...@REDIFFMAIL.COMwrote:
>>On May 24, 8:50 am, mailsu...@gmail.com wrote:
I would like to know the SQL statement for displaying only the column names of a particular table. For eg. if I have a table by the name DETAILS and it has three columns FIRST_NAME, LAST_NAME and DT_OF_BIRTH, using what SQL statement can I display only the column names and not their content ?
SELECT TABNAME,COLNAME from SYSCAT.COLUMNS where TABNAME='DETAILS'
In addition to situs answer, I you are running your query from a host
language such as java, a common trick is to select from the table with a
predicate that is always false, and then grab the metadata from the
resultset. I.e.
select * from DETAILS where 1=0
I'm not saying that this is better, only that it is another possability
Or how about 'DESCRIBE TABLE DETAILS' This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Joe Gazda |
last post by:
I'm a relative newbie to PHP, but have been able to put together some PHP
code to generate a CSV/XLS file from a Query result. Now, I would like to
include custom column names instead of the MySQL...
|
by: noor |
last post by:
Hi
I have been working since 2 days to device a method to export sql table
into csv format. I have tried using bcp with format option to keep the
column names but I'm unable to transfer the file...
|
by: Piotr Kurpiel |
last post by:
Hello,
I am using MS Access 2003 with VBScript. I have quite strange column names
which are: 1,2,3,4,etc... Data Types of the columns are Yes/No and formats
True/False. The first thing I want to...
|
by: Harry Whitehouse |
last post by:
How might one go about this. I know how to select data records, but suppose
I wanted to fill a datagrid with the column names in a specified table? How
would I start?
TIA
Harry
|
by: |
last post by:
Need help finding simple way to retrieve a fields (or
columns) collection from a Dataset without filling it
first.
|
by: craigkenisston |
last post by:
Im trying to make an application using all the out of the box stuff for
data displaying. Using (or trying to) use a BLL and DLL.
Now, in my database, the tables and columns have names like these:
...
|
by: christianlott1 |
last post by:
I want to provide users with an interface to create a custom merge
(all in Access, not Word). User will put in a set of brackets ("<>")
in a memo field and when they click the merge button it will...
|
by: bugs2bugs |
last post by:
Hello,
We're using SQL Server 2000 and Query Manager (not Visual Studio). When your query results are returned, the column names are displayed at the top, but this information is NOT available for...
|
by: ncsthbell |
last post by:
Once again... I am supporting another Access database that I did not build. The previous 'owner' of this built the tables with spaces in the table names as well as the column names. I am having a...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |