cancel
Showing results for 
Search instead for 
Did you mean: 

CURSOR - FETCH Statement

Former Member
0 Kudos
2,189

Hello!

I have a small problem in SQL, I hope someone can help me.

I want a CURSOR - FETCH, but the code did not return anything.

I use ASE 15.0.3, SQL Advantage 11 and the following code:

create procedure sales
as
declare @sale_id tid
declare @product varchar(80)
declare sales_cur cursor for
select sale_id, product
from sales
where product = 1
open sales
fetch sales
into @sale_id, @product
while (@@sqlstatus = 0)
begin
select @sale_id, @product
end


But nothing happens ... what am I wrong?

Accepted Solutions (0)

Answers (1)

Answers (1)

MarkCulp
Participant
0 Kudos

This forum is for questions about SQL Anywhere. Please refer to the FAQ page and post your ASE question on the ASE forum (link is in the FAQ).