Solved

Append querie to multiple table

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

13 Experts available now in Live!

Get 1:1 Help Now