Help Please
-
I am inserting Data from one form into two linked tables but i don't know the sql syntax for such a query, plz send me an example.
yasso
Please explain clearly what you need.:confused::confused::confused:
Regards, Arun Kumar.A
-
Please explain clearly what you need.:confused::confused::confused:
Regards, Arun Kumar.A
Hi Arun thnx for being interested. As i told u i want the SQL insert query syntax to insert data into two linked tables. lets say this is the syntax to insert data into one table INSERT INTO TABLE1(column1, column2) VAlUES (x, y) whats is the syntax to insert data into two linked tables or more. thanx for ur help
yasso
-
Hi Arun thnx for being interested. As i told u i want the SQL insert query syntax to insert data into two linked tables. lets say this is the syntax to insert data into one table INSERT INTO TABLE1(column1, column2) VAlUES (x, y) whats is the syntax to insert data into two linked tables or more. thanx for ur help
yasso
Why can't you use 2 separate insert statements?
Regards, Arun Kumar.A
-
Why can't you use 2 separate insert statements?
Regards, Arun Kumar.A
i used them but its gave a syntax error. Look this is what am going to do: I am inserting data from one form into two linked tables "Student" and "Grade" linked together by the Grade_ID column which is a primary key in the Grade table and a forgien key in the Student table. After i insert the data i go to the database to see that the primary key in the Grade table is inserted and its ok but the forgien key in the student table is still null. How can i link them together so that the forgien key in the Student table can take the same value as that in the grade table.
yasso
-
i used them but its gave a syntax error. Look this is what am going to do: I am inserting data from one form into two linked tables "Student" and "Grade" linked together by the Grade_ID column which is a primary key in the Grade table and a forgien key in the Student table. After i insert the data i go to the database to see that the primary key in the Grade table is inserted and its ok but the forgien key in the student table is still null. How can i link them together so that the forgien key in the Student table can take the same value as that in the grade table.
yasso
How can you say that the foreign key column will be updated automatically when the primary key column is updated? I think you have to use two insert statements like: insert into Student(GradeID,OthercolumnName) values(GradeValue,OthercolumnValue) insert into Grade(GradeID,OthercolumnName) values(GradeValue,OthercolumnValue).
Regards, Arun Kumar.A