How to get the column count and column name from the

resultset in the database connection program?

Answers were Sorted based on User's Feedback



How to get the column count and column name from the resultset in the database connection program..

Answer / punit

in ur mysql database there is 1 database with name
information_schema,
so 1st type,
use information_schema;
inthis data base there is 1 table COLUMNS which contain all
the info related to allthe tables in ur mysql,

so hit the following queri for youe column count:-
select count(*) from COLUMNS where TABLE_NAME='Table name';

Is This Answer Correct ?    0 Yes 1 No

How to get the column count and column name from the resultset in the database connection program..

Answer / sreeprasad

you use following sql query

select column name, count(column name)from table name.

Is This Answer Correct ?    4 Yes 6 No

How to get the column count and column name from the resultset in the database connection program..

Answer / uday kumar_anem

Hello friends, just observe the question.

It is not Datatable, it is database connection program.

Say i user "select * from table"

Here i dont know how many col r there in my table.

So give the answer to find the number of columns in that
table.

Is This Answer Correct ?    0 Yes 2 No

How to get the column count and column name from the resultset in the database connection program..

Answer / sreeprasad

Thanq Akshara..

Is This Answer Correct ?    0 Yes 3 No

How to get the column count and column name from the resultset in the database connection program..

Answer / akshara

in the vb script we use genralluy to count the rows as
rowcount=datatabble.GetSheet("Sheet name").GetRowCount
MsgBox(rowcount)
i fyou need sheet count
datatable.getcheetcount
Thank you

Is This Answer Correct ?    0 Yes 5 No

How to get the column count and column name from the resultset in the database connection program..

Answer / prasad

Select column_name, count(column_name) from user_tab_columns
where table_name='EMP' group by rollup(column_name);

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More QTP Interview Questions

Are You using any frame work? What is that? Explain about that.

4 Answers   Wipro,


What is the difference between Action and Function.? when both has the same functionaltiy, when do we choose Action and when do we choose Function..??

3 Answers   DST Global Solutions,


what are pretesting activities

0 Answers  


how we can know qtp has used smart identification machanism during the execution.

3 Answers   IBM,


I am using DataTable.ImportSheet method to import the data from an excel sheet to the Runtime DataTable of QTP. here is my piece of code DataTable.import("c:\DataSheet.xls","Members","Members") The first row headings of Members sheet of DataSheet.xls and Members sheet of QTp are matched. but the QTP is taking very long time(approximately half an hour) to import the data into runtime datatable even though the DataSheet.xls has one or two rows in it. Please let me know why this is happening and is there any alternative for impoting the data into runtime datatable of qtp ?

2 Answers  






It is regarding VBScript, how to export our function results to ExcelSheet through VBscripting. Ex: I have written add function, that result should export to Excel.

3 Answers  


What is QTP and the use of QTP in TD?

0 Answers   MaxSolPro,


Can any give an example(if possible templates) how to test web application using QTP. thanks in advance

0 Answers  


How to do call a output parameter from one action to another action??/

0 Answers   TCS,


What is the use of "New Property" in "Add properties" of testobject properties in object repository. How can i use "New properties" while writing scripts if i have assign some values to the testobject properties Can anyone help me? plz

0 Answers   Livetek,


For Data-Driven testing can you use micro soft word document instead of using Datatable what is your approach?

0 Answers   Nokia,


can u please explain what r the challenges u faced in ur automation testing

2 Answers   Genpact,


Categories