468,525 Members | 2,247 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,525 developers. It's quick & easy.

INSERT from existing records of the same table

the following SQL is not acceepted by DB2 V7:

INSERT
INTO BLT15
VALUES
SELECT
A.TNR
, A.LNR
, A.LINDEX
, 'P'
, 'E'
, 'S'
, CURRENT DATE
, CURRENT TIME
FROM
BLT15 A
WHERE
A.BA_TAB = 'S'
AND NOT EXISTS
( SELECT 1 FROM BLT15 B
WHERE
A.TNR = B.TNR
AND A.LNR = B.LNR
AND A.LINDEX = B.LINDEX
AND B.BA_TAB = 'P' )
;

any ideas how to realize with SPUFI/QMF?

greetings michael


Nov 12 '05 #1
1 3198
"michael Tepperis" <ex******************************@volkswagen.de> wrote in
message news:bp*********@doiweb4.volkswagen.de...
the following SQL is not acceepted by DB2 V7:

INSERT
INTO BLT15
VALUES
SELECT
A.TNR
, A.LNR
, A.LINDEX
, 'P'
, 'E'
, 'S'
, CURRENT DATE
, CURRENT TIME
FROM
BLT15 A
WHERE
A.BA_TAB = 'S'
AND NOT EXISTS
( SELECT 1 FROM BLT15 B
WHERE
A.TNR = B.TNR
AND A.LNR = B.LNR
AND A.LINDEX = B.LINDEX
AND B.BA_TAB = 'P' )
;

any ideas how to realize with SPUFI/QMF?

greetings michael

Get rid of the VALUES clause. Values clause is not used when a full-select
is present for the data.
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Philip Boonzaaier | last post: by
11 posts views Thread by Sezai YILMAZ | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.