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?

asked 14 Apr '14, 22:57

Arcanomus's gravatar image

Arcanomus
1112
accept rate: 0%

closed 15 Apr '14, 02:39

Mark%20Culp's gravatar image

Mark Culp
22.9k9129270

The question has been closed for the following reason "Question is off-topic or not relevant" by Mark Culp 15 Apr '14, 02:39


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).

permanent link

answered 15 Apr '14, 02:39

Mark%20Culp's gravatar image

Mark Culp
22.9k9129270
accept rate: 40%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×48
×4

question asked: 14 Apr '14, 22:57

question was seen: 532 times

last updated: 15 Apr '14, 02:39