Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 10th, 2003, 09:28 AM
don_sparko's Avatar
don_sparko don_sparko is offline
Digitally Challenged
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 280 don_sparko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 14 sec
Reputation Power: 6
cursors and stored procs

looking for some help on a stored procedure. here is what i have. it is supposed to insert the unique values from an existing table into a new table. should be 40, but instead it continually puts in blank values and won't stop. so here's the proc.
Code:
CREATE PROCEDURE sp_filltitletable
AS
declare title_curs cursor for
select title
from employee group by title
for read only

declare @actualtitle varchar(50)

open title_curs
fetch title_curs into @actualtitle
while @@fetch_status = 0
begin
insert into Emp_Title (Title) values (@actualtitle)
end
close title_curs
deallocate title_curs


fugured it out. had the fetch in the wrong spot!
__________________
My brain cells are like a storm trooper's armor: useless

Last edited by don_sparko : November 10th, 2003 at 09:36 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > cursors and stored procs


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway