Solved

Append querie to multiple table

Posted on 1998-06-03
1
133 Views
Last Modified: 2010-04-06
I want to use an append querie, but I don't know how to design it because the data I have to add belong to more thant one table. Ex.: I want to add a new client in the "Client" table, and add at the same time more info on him in the "Caracteristics" table. How can I add my info so the relations between my table are respected (primary key and foreign key).
0
Comment
Question by:pjroy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
Marcius earned 40 total points
ID: 1350112
If you want to add information from another table into an append statement, you have to add sub-queries. See below...

update client
set name = (select name
            from characteristics ch, client cl
            where ch.keyvalue = cl.keyvalue)
where keyvalue = (select keyvalue
                  from characteristics ch, client cl
                  where ch.keyvalue = cl.keyvalue)

Or something like that... I think that should allow you to reference other tables from within your append query, thus allowing you to check key values etc.

As for adding data into two tables in the same query, I really don't think that can be done. Why not use two queries ? It will make your life much easier :)
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question