Solved

"Rowset column could not be found."

Posted on 2013-05-30
7
360 Views
Last Modified: 2013-06-03
I have a script (SP) about 900 lines long that has been running for 7+ years  I need to delete some rows from a temp table, and I have added the following code:

----
---- delete records for WBC or RBC registrations through OnlinePass
----
--drop table tmp1
-- select ol.order_number,om.meeting,om.REGISTRANT_CLASS
-- into tmp1
-- from Order_Lines ol
-- left outer join Order_Meet om on ol.ORDER_NUMBER = om.ORDER_NUMBER
-- where RIGHT(ol.product_code,7) = 'WBC/REG' and om.registrant_class = 'pass'
-- select * from tmp1

--declare @opc varchar(31)
--declare @onum  float
--declare curdel cursor for
--select order_number, meeting from tmp1
----
---- Open Cursor
----

--      Open curdel
      
----
---- Fetch loop
----
--      fetch next from curdel into @onum, @opc
--      while @@FETCH_STATUS = 0
--      begin
--            set @opc = @opc + '/REG'
--            delete from #dailysalesdetail where ORDER_NUMBER = @onum and PRODUCT_CODE = @opc
--            fetch next from curdel into @onum, @opc      
--      end
--      close curdel
--      deallocate curdel
 
 
 
-- drop table tmp1
-- select ol.order_number,om.meeting,om.REGISTRANT_CLASS
-- into tmp1
-- from Order_Lines ol
-- left outer join Order_Meet om on ol.ORDER_NUMBER = om.ORDER_NUMBER
-- where RIGHT(ol.product_code,7) = 'RBC/REG' and om.registrant_class = 'pass'
-- select * from tmp1


--declare curdel cursor for
--select order_number, meeting from tmp1
----
---- Open Cursor
----

--      Open curdel
      
----
---- Fetch loop
----
--      fetch next from curdel into @onum, @opc
--      while @@FETCH_STATUS = 0
--      begin
--            set @opc = @opc + '/REG'
--            delete from #dailysalesdetail where ORDER_NUMBER = @onum and PRODUCT_CODE = @opc
--            fetch next from curdel into @onum, @opc      
--      end
--      close curdel
--      deallocate curdel

If I run the script in SSMS runs fine.  If I run it in Crystal i get the above error.?????
0
Comment
Question by:Jeff_Kingston
7 Comments
 
LVL 40

Expert Comment

by:Sharath
ID: 39209227
What is error that you are getting?
0
 
LVL 16

Assisted Solution

by:DcpKing
DcpKing earned 167 total points
ID: 39209693
When you run it in SSMS what does it return? Two values? Are they named the same as Crystal expects them to be named?
0
 

Author Comment

by:Jeff_Kingston
ID: 39210424
I select three field into table tmp1.
Using a cursor I loop thru the table and delete records from a temp table #dailysalesdetail.

As the title suggests I get "rowset column could not be found".

In SSMS script runs to completion.

in Crystal I get the error.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 48

Expert Comment

by:PortletPaul
ID: 39210441
>>in Crystal I get the error.
and the error is?

??If I run it in Crystal i get the above error.?????
there was no error provided ('above' or 'below')

could you please provide the full error message and any associated text?
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 333 total points
ID: 39213121
it looks like you are missing SET NOCOUNT ON at the top of your script, so Crystal is not picking up any result set.
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 333 total points
ID: 39213128
If I run the script in SSMS runs fine.  If I run it in Crystal i get the above error.?????
Then you need to take a second look, as you are comparing apples to oranges and preferably using Results to Text (and not Results to Grid).  Notice how there are at least one message like the following prior to the result set you need:
(x row(s) affected)

If that is the case, then that is your problem.
0
 

Author Closing Comment

by:Jeff_Kingston
ID: 39216823
I stumbled across the problem ... during debugging a "drop table" statement was added to the code so I could run a portion of the script several times ....as soon as I commented out that line all is well....  not sure I understand why.  

Thanks for the insight into causes for this error.  I have added them to my tricks of the trade folder for the next time I nap while coding.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how the fundamental information of how to create a table.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now