Highlighted

Extract row ID from a query (from cfspeadsheet)

New Here ,
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

164

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

Extract row ID from a query (from cfspeadsheet)

New Here ,
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

165

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
Jun 06, 2017 0
New Here ,
Jun 06, 2017

Copy link to clipboard

Copied

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
Reply
Loading...
Jun 06, 2017 0