on 2020 Jun 05 1:02 PM
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!
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
User | Count |
---|---|
91 | |
11 | |
9 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.