CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge -> Programming

 Deleting Rows in Multiple Tables

Print topic Send  topic

Author Message
Koren
Posted: 10/21/2005, 12:50 PM

In CCS-custom delete (in a record) (TYPE-SQL) I want to implement the following SQL statement (I'm using MySQL 4.0)

I have 4 tables (T1, T2, T3, T4)
T1 - has the object that I would like to delete (across these tables) as the pk (known as object_pk)
T4 - will have one row of info that would correspond to T1's pk (with the field object_pk)
BOTH T2 & T3 has many rows would correspond to T1's pk (with the field object_pk)

I have been trying to create a delete command that would delete all references to T1's pk in all the tables listed above.

I was hoping that it was as easy as:
DELETE FROM T1, T2, T3, T4
WHERE object_pk = 1

But realized quickly that wasn't the way to go. Been trying various join statments but, being the noob that I am, surely have the syntax all messed up.

Any help would be GREAT! thanks!

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.