If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > Help with Cursor - ASA 9.0

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-03-08, 13:53
venusgirrl venusgirrl is offline
Registered User
 
Join Date: Aug 2003
Location: São Paulo - Brazil
Posts: 8
Help with Cursor - ASA 9.0

Hello there, I am using cursors for the first time and I need help.
My stored procedure:
...
begin
declare Teste_Cursor dynamic scroll cursor for
select cod_customer from t_sic_books_proxy
where id = @NUM_ID
and cod_user not in ('DEFINIDO', 'PAGTOS')

open Teste_Cursor

while 1=1
begin
fetch next Teste_Cursor into @DIVIDA

select
case @DIVIDA
when '1539' then '<img src="http://www.gatosdocampodesantana.kit.net/realidade/0.jpg>'
when '1406' then '<img src="http://www.gatosdocampodesantana.kit.net/realidade/3.jpg>'
end

end


close Teste_Cursor
end

----------------------------------
ps - the variabel @DIVIDA is declared.

- This query returns 2 results and I need to make a select case and show a different image to each one.
ok, i run my procedure and it locks my user (in this case I am using DBA) as "CURSOR OPEN" and did not finish the steps.
Maybe I am declaring the cursor in a wrong way, but I tried a lot and it doesnt work out.


I hope you, that are more experienced could help me.
Thanks in advance,

venusgirrl
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On