Advertisement

10.13.2007 at 08:02AM PDT, ID: 22891307
[x]
Attachment Details

Using INSERT in multiple tables that are linked with a Primary Key

Asked by RETEZE in Informix Database

Tags: insert, multiple, tables, key, primary

I am new to SQL and need to figure out how to insert coulmns into two tables that are linked by a primary key.

I tried:
 INSERT INTO tableone(data1, data2, data,3)
             VALUES (1,2,3);
 INSERT INTO tabletwo(data1, data4, data,5)
             VALUES (1,7,8)
This only inserts the data in tableone. table two errors out with a primary key error.

Any help is much appreciated.Start Free Trial
[+][-]10.13.2007 at 08:23AM PDT, ID: 20071208

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.13.2007 at 10:35AM PDT, ID: 20071507

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2007 at 11:34AM PDT, ID: 20071637

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.13.2007 at 03:17PM PDT, ID: 20072114

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2007 at 11:45PM PDT, ID: 20073043

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.14.2007 at 06:25AM PDT, ID: 20073682

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.14.2007 at 11:24AM PDT, ID: 20074450

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Informix Database
Tags: insert, multiple, tables, key, primary
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628