The forum will be down for maintenance at some point from Friday, November 16 at 19:00 EDT until Sunday, November 18 at 23:59 EDT. Downtime will be minimized but the exact timing is unknown.

I'm using and want to count the records that are exported by an UNLOAD SELECT statement. So I'm querying the @@rowcount global variable right after the statement.

However, @@rowcount seems to ignore the UNLOAD statement, i.e. its value is unchanged by the UNLOAD statement.

So do I need to count the number of rows myself?

I could not find any documentation of @@rowcount related to UNLOAD.

asked 25 Jul, 04:16

Volker%20Barth's gravatar image

Volker Barth
accept rate: 32%

All too often, I miss the chance to look at the documentation of newer versions...

That quote is from to v17 "What's New" section:

Enhancements to the UNLOAD statement
@@rowcount global variable now incremented during unloading
The UNLOAD statement now sets the @@rowcount variable to the number of rows unloaded. See UNLOAD statement.

So, for v16 and below, apparently I have to count myself...

permanent link

answered 25 Jul, 04:20

Volker%20Barth's gravatar image

Volker Barth
accept rate: 32%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 25 Jul, 04:16

question was seen: 130 times

last updated: 25 Jul, 04:20