Cascading delete in php and oracle

From: Date: Fri, 21 Feb 2003 17:46:01 +0000
Subject: Cascading delete in php and oracle
Groups: php.general 
Request: Send a blank email to php-general+get-136545@lists.php.net to get a copy of this message
hi, i have 2 tables in oracle create table Shop( ordId NUMBER(7) NOT NULL PRIMARY KEY); create table Customer( ordId NUMBER(7) NOT NULL, FOREIGN KEY (ordId) REFERENCES Orders(ordId) on delete cascade); so, when i delete a row in shop, the corresponding row in customer will be deleted. so, i have created a function in php to execute the query whereby $sqlStmt = "Delete from Shop where ordId = $ordId"; function executeSql($sqlStmt) //line 524 { //echo $sqlStmt; $this->stmt = OCIParse($this->conn, $sqlStmt)or die ("Sorry, cannot parse the sql statement. Please inform the webmistress of the error messages"); // verify that SQL is valid $this->checkErrors(); OCIExecute($this->stmt, OCI_DEFAULT) or die //line 534 ("Sorry, cannot execute the sql statement. Please inform the webmistress of the error messages"); $this->checkErrors(); //commit to database $this->commit(); } however, when i tried to execute the sql stmt, an error stmt will occur : Warning: Missing argument 1 for executesql() in c:\apache\htdocs\project\ProcessSql.php on line 524 Warning: OCIStmtExecute: ORA-24337: statement handle not prepared in c:\apache\htdocs\project\ProcessSql.php on line 534 Sorry, cannot execute the sql statement. Please inform the webmistress of the error messages This function works for tables that do not have cascading deletes. How do i get round this problem? thanx :P --

« previous php.general (#136545) next »