Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Iteration over SQL result in SQLScript procedure has an error

$
0
0

Hello Stefan

 

I believe you mean this code

 

DECLARE v_isbn VARCHAR(20);

 

--missing code in the example

DECLARE v_title VARCHAR(20);

DECLARE v_price VARCHAR(20);

DECLARE v_crcy VARCHAR(20);

 

DECLARE CURSOR c_cursor1 (v_isbn VARCHAR(20)) FOR SELECT isbn, title, price, crcy

FROM books

WHERE isbn = :v_isbn ORDER BY isbn;

....

 

 

Should'nt you be passing a parameter to the cursor?

 

The documentation is incorrect in using the same variable name ..... its just confusing

 

the v_isbn in the cursor and v_isbn in the Scalar variable declaration are different.

 

you will see the Scalar variable used later as

 

FETCH c_cursor1 INTO v_isbn, v_title, v_price, v_crcy;

 

Incidentally you need to declare v_title, v_price, v_crcy too just like v_isbn is which is missing too!!

 

 

Warm regards

aadi


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>