How to print all the result without using Results.columnname in ColdFusion
for ex:-
I have <cfquery name="getProductId">
select productId
from product
</cfquery>
In Product Table i have 2 columns with product_name and Product_id.
How can I print them without using
getProductId.product_name
getProductId.Product_id
Thanks,
What are you trying to achieve? If you are looking for a way to computationally output query results based on a query whose column names you do not know, such as…
…then you can use the
queryName.ColumnListvariable, which returns a comma separated list of all column names. You could subsequently iterate over this list, and output as required.For example, to get a simple HTML table output:
Apologies if this isn’t what you meant!