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 83563
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='DETAIL S'
On May 24, 2:19 pm, situ <SRIDHAR...@RED IFFMAIL.COMwrot e:
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='DETAIL S'
Thanks ! ma*******@gmail .com wrote:
On May 24, 2:19 pm, situ <SRIDHAR...@RED IFFMAIL.COMwrot e:
>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='DETAIL S'
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...@RED IFFMAIL.COMwrot e:
>>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='DETAIL S'
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 column table names. I know
that there are codes to generate tabs and carriage returns, but can't find
anything about including "commas" in a string...
|
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 with column names. and
also I'm having problems on columns having decimal data.
Can any one suggest me how to automate data transfer(by using SP) and...
|
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 do is count rows with True in column
1, then column 2, etc. My query is: "SELECT count(*) AS ile FROM profiles
WHERE 1 = True" It doesn't work. I...
|
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:
Table TBL01_PRODUCT
Col PRD_CODE
Col PRD_NAME
etc, etc
What I mean, they are cryptic, not friendly names.
|
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 grab the
fields listed in a tabular subform and merge it with their memo text.
I was able to retrieve the code to list the column names of a...
|
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 cut/paste to Excel. One of the workarounds we thought of was to return the column names within the query itself, and thought there was perhaps an...
|
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 difficult time getting the select statement to work. I am getting a run-time error 2342. "A RunSql action requires and arguement consisting fo an SQL...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |