Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Extract row ID from a query (from cfspeadsheet)

New Here ,
Jun 06, 2017 Jun 06, 2017

Copy link to clipboard

Copied

Hello,

I working with Coldfusion 10.

I use cfspreadsheet for reading an Excel document. The result is in query. See example below.

As you see (black circled) you have the row ID 1, 2 and 3 (representing the row number of the Excel sheet).

Query.jpg

I would like to read that value.

Question:

How can I read this value ?

Reason:

I must make a query of query to filter data.

In case of mistake (bad values or missing values) I must display an error message which explain that "wrong value on row xxx".

After the query of query, the quantity of rows are not the same as the Excel document and the row id is not correct.

My ideas is to add a column to the result of query of the query with the row id of the original query (which represent the row number).

I already search on internet, this forum. But I don't know how to do that !

Or any one have a better ideas?

Thank you so much for your help

Best regards

André L'Hoir

Views

189

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 06, 2017 Jun 06, 2017

Copy link to clipboard

Copied

LATEST

Hello,

You can close the issue. I founded the solution (see code below)

<cfset queryAddColumn(YourQuery, "RowNum", ArrayNew(1)) />

<cfloop query="YourQuery">

   <cfset querySetCell(YourQuery, "RowNum", YourQuery.currentRow, YourQuery.currentRow) />

</cfloop>

So.. Thanks

Best regards

André L'Hoir

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines