Forums Register Login

Select Particular Column values in sql without know the column name

+Pie Number of slices to send: Send
I want to get particular column values in sql table.For example if table has 10 columns i want to select the values of 4 to 10 column values. Here i dont know the column names because all columns are generated at a run time. i need help as soon as possible. I have searched in lot but i could not find the sql query.
+Pie Number of slices to send: Send
After you execute your query and in the rs.next loop do the following:

Instead of calling the fieldname you can get the value by index of the column.
+Pie Number of slices to send: Send
There also should be a way to query for the column names in your code. It would depend on what api you are using to connect/run against the DB.
+Pie Number of slices to send: Send
Thanks for your reply.

I want the sql query to select records
+Pie Number of slices to send: Send
If you want the column names you can get them as follows:
Come have lunch with me Arthur. Adventure will follow. This tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2757 times.
Similar Threads
Getting table name for column
h:dataTable creating dynamically
Problem with preapred Statement
Getting sql error [Microsoft ][odbc microsoft access driver]numeric index out of range
call resultset in join query
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:46:47.