sql - nested cursor, code won't update table outside of cursors -
I'm working on the nested cursor. Does not update my update statement table leading cancer let me know that all looping is working because the print statement will print, but some edu_suffix_stage_test does not update I can expect is a suggestion I am!
For each ID, there is a major line of data, and the year has been achieved that degree. I need string to simultaneously
For example, Reed 10013 has two records for two degrees: ..
In Civil Engineering '38, and in Civil Engineering '41, I need to make Adhesives, so it is equivalent to "Civil Engineering" of "Civil Engineering'38". finally need a edusuffix per Reid, in edu_suffix_stage_test
Thank you
here is my code: ..
@reid_outside nvarchar announced (20 ), @major nvarchar (50), nvarchar @classof (5), @edusuffix_inside varchar (80), @note nvarchar (select 50), @reid_inside nvarchar (20), @edusuffix_outside varchar (80) education_cursor for Reed Let the cursor declare The edusuffix Edu_suffix_stage_test where Reed & lt; 1005 - Select by introducing Open Educational cancer @reid_outside further education Caesar FETCH, @edusuffix_outside WHILE @@ FETCH_STATUS = 0 Adiariar to @ NOTE = "Print Building Adsfiks' @ Note Print @reid_outside - an internal cursor announced that a declaration on the major_cursor cursor to select v.reid hidden from external cursor v.EduMajor, where v.EduClassOF re_education V v.REID = @reid_outside - edusuffix updated open V.REID for external cursor - variable values from the order Major_cursor do not bring major_cursor @reid_inside from next, @major, while @classof @@ FETCH_STATUS = 0 select @edusuffix_inside = @major + '+ + @classof +', 'print @edusuffix_inside update edu_suffix_stage_test when @edusuffix_outside = null then Set edusuffix = case 'start' + @edusuffix_inside else @edusuffix_outside + ',' @ edusuffix_inside end edu_suffix_stage_test from a where - a.reid = @reid_inside current educationcissor print 'update edusuffix' from FETCH leading IKnow @reid_inside, @major, @ Classof END Closed Key Links DEALLOCATE Head Cascor FETCH prior to education for cursor @reid_outside, @edusufix_outside END Closed Education CANASA DEALLOCATE SHI Classroom cursor
In fact, the wrong thing with no cursor in my update statement is flawed ! I do not know what I was thinking, comparisons of such a null would not work. I am also working on a better case statement, and will use isnull () when I will do it, then I will post it
Comments
Post a Comment