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 |
|
imughal
Posting Yak Master
192 Posts |
Posted - 2004-06-08 : 02:09:54
|
| hi,i am looking for navigate and display record in stored procedure.to navigate record i have uased below cursorDECLARE my_cursor CURSORFOR select filename from fileinfo where caclientsloginid=11WHILE @@FETCH_STATUS = 0BEGIN FETCH NEXT From my_cursorENDnow i want to display each record fetch by the cursor. tell me how to display each record. regards, irfan |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2004-06-08 : 02:34:24
|
| Check out Books Online for cursor syntax.As a quick guide, you need to declare variables to receive the output of the cursor statement:DECLARE @cFileName varchar(50)DECLARE my_cursor CURSORFOR select filename from fileinfo where caclientsloginid=11OPEN my_cursorFETCH NEXT FROM my_cursor INTO @cFileNameWHILE @@FETCH_STATUS = 0BEGIN Print @cFileName FETCH NEXT From my_cursor INTO @cFileNameENDCLOSE my_cursorDEALLOCATE my_cursor |
 |
|
|
imughal
Posting Yak Master
192 Posts |
Posted - 2004-06-08 : 03:04:01
|
| thanks for your reply. is there anyway to retrieve these record in asp and display through asp file like while not eof. i m using but getting following errorOperation is not allowed when the object is closed. |
 |
|
|
mr_mist
Grunnio
1870 Posts |
Posted - 2004-06-08 : 03:46:58
|
| You would be better off fetching a range of rows using something like getrows() and then paging through them at the ASP side. The method you are suggesting here would be most inefficient.-------Moo. :) |
 |
|
|
|
|
|