cancel
Showing results for 
Search instead for 
Did you mean: 

cursor variable doesnt work

jwiebe
Explorer
0 Kudos
305

Hello,

i want to use a cursor in my procedure, but somehow it doesnt work.

DECLARE CURSOR <cursor_name> FOR SELECT "TITLE", "MESSAGE" FROM <table name> AD JOIN <table name> CD ON AD.<column_1> = CD.<column_1> AND AD.<column_2>" = CD.<column_2> WHERE CONTAINS (EXTENDED_KEYWORD, <specific string>) AND NEWS_ITEM_TIMESTAMP > '2020-03-19 15:00:00.000000000' AND NEWS_ITEM_TIMESTAMP < '2020-03-19 20:05:00.000000000' ORDER BY TITLE;

i want to iterate over the cursor to insert specific values to different tables.

somehow it doesnt work.

if i change "DECLARE CURSOR <cursor_name> FOR" with "temp_tab =", so a table variable would be initiated, it works.

I dont know why.

Thank you for any suggestions!

Accepted Solutions (0)

Answers (0)