Solved

Append querie to multiple table

Posted on 1998-06-03
1
130 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now