473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to get the no. of columns?

58
Is there any way to get the number of columns in a MySql table???
Oct 10 '07 #1
4 3746
Atli
5,058 Expert 4TB
Hi.

You have posted this in the Articles section rather than in Forums. I have moved it across for you.
Please try to post your questions in the forums in the future!

Moderator
Oct 10 '07 #2
Atli
5,058 Expert 4TB
You can use the 'INFORMATION_SCHEMA' database to find things like that:
Expand|Select|Wrap|Line Numbers
  1. SELECT COUNT(*) AS 'Count' 
  2. FROM INFORMATION_SCHEMA.COLUMNS
  3. WHERE TABLE_NAME = 'tblName'
  4. AND TABLE_SCHEMA = 'dbName' 
  5.  
Oct 10 '07 #3
jith87
58
thanx ere................. it worked out for me......
Oct 10 '07 #4
bartonc
6,596 Expert 4TB
Is there any way to get the number of columns in a MySql table???
If you API supports cursors (the way Python does), then this info is contained in the cursor after the query (number of columns actually queried, not necessarily the number in the table):
Expand|Select|Wrap|Line Numbers
  1. nCols = len(cursor.description)
Oct 10 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: VA | last post by:
I got the following function to swap table columns from somewhere on the Internet function swapColumns (table, colIndex1, colIndex2) { if (table && table.rows && table.insertBefore && colIndex1...
2
by: Kevin | last post by:
Hi Al Can someone tell me how to hide colums in a datagrid. I have a one datagrid that is a master and child and I would like to hide specific columns, how do I do this TI Kevin
1
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
2
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
13
by: scorpion53061 | last post by:
Very urgent and I am very close but need a little help to get me over the edge........ I need to write these columns to a html file with each row containing these columns (seperated by breaks)....
5
by: Gary Blakely | last post by:
I'm giving this post another try - it can't be too difficult for everyone.... In the program below, the web page has dataGrid1. the only thing that has been done to it at design time is to...
2
by: Dibs | last post by:
Hi all, short question. is there anyway of changing the order of a datatable's columns? cheers, Dibs
1
by: thomasp | last post by:
Will someone tell me why with the following code: 1. The user can not resize the columns 2. The DTG column is not formatted as "dd-MMM-yy HH:mm:ss" 3. The user can modify the data in all...
0
by: bappelsin | last post by:
Hello, I have a problem with the datagridview. I have a view with around 25 different columns. To make life easier for the users I have implemented a popup dialog where the user can select which...
5
by: explode | last post by:
I made a procedure Public Sub Novo(ByVal nova1 As String, ByVal nova2 As String) that creates a new oledbDataAdapter with insert update select and delete commads. I also added that commands can...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
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...
0
agi2029
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,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.