473,395 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 3429
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Alex Vorobiev | last post by:
hi there, i am using sql server 7. below is the stored procedure that is giving me grief. its purpose it two-fold, depending on how it is called: either to return a pageset (based on page...
11
by: Randell D. | last post by:
Folks, I have a table of addresses and a seperate table with contact names - All addresses tie to one or more names - I would like to keep track of the number of names 'belonging' to an address...
14
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
11
by: Sezai YILMAZ | last post by:
Hello I need high throughput while inserting into PostgreSQL. Because of that I did some PostgreSQL insert performance tests. ------------------------------------------------------------ --...
3
by: Bob Alston | last post by:
I have a routine to copy data to new versions of my app via insert into sql statements. Unfortunately, due to evolution of my app, sometimes the new version has more restrictive editing than an...
1
by: Jan | last post by:
I have a table with autoincrement unique ID plus name (required not to be blank) and other fields. I have a list of names in another table and would like to do insert to the name field of the...
7
by: bbasberg | last post by:
Hello, I thought I would do a "sanity check" by asking the experts how to do the following: I need to process external data (it will be in an Access DB table and will be updated daily) into a...
2
by: mivey4 | last post by:
Okay I have 2 tables: Table A - holds a list of new hardware serial numbers and their corresponding model (no constraints or indexes) Table B - holds a distinct list of current serial numbers...
1
by: imtmub | last post by:
I have wko(Workorder) table exist in my ERP. Now i have some excel sheet that contains some new workorder(more than1000 Records). Now i need to insert all the records which present in the sheet to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.