Delete in COBOL DB2 with fetch first 100 rows
up vote
0
down vote
favorite
Below is my query that am using in cobol db2 module
EXEC SQL
DELETE FROM AA_AA
WHERE A=0
FETCH FIRST 30 ROWS ONLY
END-EXEC
I could see the below error while compiling
INVALID KEYWORD 'FETCH' VALID SYMBOLS ARE: AND OR QUERYNO SKIP WITH DELETE FROM AA_AA WHERE A=0 FETCH FIRST 30 ROWS ONLY
db2 delete-row cobol
add a comment |
up vote
0
down vote
favorite
Below is my query that am using in cobol db2 module
EXEC SQL
DELETE FROM AA_AA
WHERE A=0
FETCH FIRST 30 ROWS ONLY
END-EXEC
I could see the below error while compiling
INVALID KEYWORD 'FETCH' VALID SYMBOLS ARE: AND OR QUERYNO SKIP WITH DELETE FROM AA_AA WHERE A=0 FETCH FIRST 30 ROWS ONLY
db2 delete-row cobol
1
The Fetch is not valid in a Delete query. Plus you can't ask to delete any 30 rows, you must provide a condition that will discriminate those records from the ones you need to keep. Perhaps you could explain us what you intended to do in the first place. By the way, this is a DB2/SQL question and has almost nothing to do with cobol.
– David Larochette
Nov 10 at 16:17
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Below is my query that am using in cobol db2 module
EXEC SQL
DELETE FROM AA_AA
WHERE A=0
FETCH FIRST 30 ROWS ONLY
END-EXEC
I could see the below error while compiling
INVALID KEYWORD 'FETCH' VALID SYMBOLS ARE: AND OR QUERYNO SKIP WITH DELETE FROM AA_AA WHERE A=0 FETCH FIRST 30 ROWS ONLY
db2 delete-row cobol
Below is my query that am using in cobol db2 module
EXEC SQL
DELETE FROM AA_AA
WHERE A=0
FETCH FIRST 30 ROWS ONLY
END-EXEC
I could see the below error while compiling
INVALID KEYWORD 'FETCH' VALID SYMBOLS ARE: AND OR QUERYNO SKIP WITH DELETE FROM AA_AA WHERE A=0 FETCH FIRST 30 ROWS ONLY
db2 delete-row cobol
db2 delete-row cobol
edited Nov 10 at 19:49
Community♦
11
11
asked Nov 8 at 4:09
Charitha
253
253
1
The Fetch is not valid in a Delete query. Plus you can't ask to delete any 30 rows, you must provide a condition that will discriminate those records from the ones you need to keep. Perhaps you could explain us what you intended to do in the first place. By the way, this is a DB2/SQL question and has almost nothing to do with cobol.
– David Larochette
Nov 10 at 16:17
add a comment |
1
The Fetch is not valid in a Delete query. Plus you can't ask to delete any 30 rows, you must provide a condition that will discriminate those records from the ones you need to keep. Perhaps you could explain us what you intended to do in the first place. By the way, this is a DB2/SQL question and has almost nothing to do with cobol.
– David Larochette
Nov 10 at 16:17
1
1
The Fetch is not valid in a Delete query. Plus you can't ask to delete any 30 rows, you must provide a condition that will discriminate those records from the ones you need to keep. Perhaps you could explain us what you intended to do in the first place. By the way, this is a DB2/SQL question and has almost nothing to do with cobol.
– David Larochette
Nov 10 at 16:17
The Fetch is not valid in a Delete query. Plus you can't ask to delete any 30 rows, you must provide a condition that will discriminate those records from the ones you need to keep. Perhaps you could explain us what you intended to do in the first place. By the way, this is a DB2/SQL question and has almost nothing to do with cobol.
– David Larochette
Nov 10 at 16:17
add a comment |
1 Answer
1
active
oldest
votes
up vote
-1
down vote
Try this:
DELETE FROM (SELECT * FROM AA_AA WHERE A = 0 FETCH FIRST 30 ROWS ONLY)
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
-1
down vote
Try this:
DELETE FROM (SELECT * FROM AA_AA WHERE A = 0 FETCH FIRST 30 ROWS ONLY)
add a comment |
up vote
-1
down vote
Try this:
DELETE FROM (SELECT * FROM AA_AA WHERE A = 0 FETCH FIRST 30 ROWS ONLY)
add a comment |
up vote
-1
down vote
up vote
-1
down vote
Try this:
DELETE FROM (SELECT * FROM AA_AA WHERE A = 0 FETCH FIRST 30 ROWS ONLY)
Try this:
DELETE FROM (SELECT * FROM AA_AA WHERE A = 0 FETCH FIRST 30 ROWS ONLY)
edited Nov 9 at 6:33
answered Nov 8 at 6:39
C4mps
14
14
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53201438%2fdelete-in-cobol-db2-with-fetch-first-100-rows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
The Fetch is not valid in a Delete query. Plus you can't ask to delete any 30 rows, you must provide a condition that will discriminate those records from the ones you need to keep. Perhaps you could explain us what you intended to do in the first place. By the way, this is a DB2/SQL question and has almost nothing to do with cobol.
– David Larochette
Nov 10 at 16:17