Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
OldMySQLUser
Constraint Violating Yak Guru
301 Posts |
Posted - 2008-04-04 : 09:27:33
|
I have this simple example from which to start learning to use cursors:USE arGODECLARE @mortgage INT DECLARE @getMortgage CURSORSET @getMortgage = CURSOR FOR SELECT Converted_Mortgage_Number FROM format_mortgage_historyOPEN @getMortgage FETCH NEXT FROM @getMortgage INTO @mortgageWHILE (@@FETCH_STATUS = 0) BEGIN PRINT @mortgage FETCH NEXT FROM @getMortgage INTO @mortgage ENDCLOSE @getMortgageDEALLOCATE @getMortgageGO Although it runs, I dont see the Converted_Mortage_Number printed. What have I done wrong please? |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-04-04 : 09:31:24
|
| Do you have records in format_mortgage_history table?Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
OldMySQLUser
Constraint Violating Yak Guru
301 Posts |
Posted - 2008-04-04 : 09:52:41
|
Thanks for that thought.As basic as it may seem, it had escaped my attention that my previous csv data conversion had not correctly created the column 'Converted_Mortgage_Number' data as expected. It was null!! Little wonder there was no output to print Oh, the shame ... |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-04-04 : 10:03:15
|
It happens sometimes..nothing to be ashamed of. Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|
|