存储过程中的存储过程

时间:2015-07-09 16:39:34

标签: sql-server-2008 stored-procedures

我有一个存储过程 <?php //Open a new connection to the MySQL server $mysqli = new mysqli('localhost','some directory','some password','some user '); //Output any connection error if ($mysqli->connect_error) { die('Connection failed : ('. $mysqli->connect_errno .') '. $mysqli->connect_error); } // check if the 'id' variable is set in URL, and check that it is valid if (isset($_GET['cd']) && is_numeric($_GET['cd'])) // get id value $id = $_GET['cd']; $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $phonenumber = $_POST['phonenumber']; $city = $_POST['city']; $state = $_POST['state']; $zipcode = $_POST['zipcode']; $dob = $_POST['dob']; $doi = $_POST['doi']; $adjustername = $_POST['adjustername']; $claimrefnumber = $_POST['claimrefnumber']; $providernature = $_POST['providernature']; $created = $_POST['created']; $language = $_POST['language']; $client = $_POST['client']; $amountauthorized = $_POST['amountauthorized']; $active = $_POST['active']; $invoiceformat = $_POST['invoiceformat']; $query = ("UPDATE tabele SET firstname, lastname, phonenumber, city, state, zipcode, dob, doi, adjustername, claimrefnumber, providernature, created,language, client, amountauthorized, active, invoiceformat, WHERE id) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); $statement = $mysqli->prepare($query); $statement->bind_param('isssssssssssssssss', $id, $firstname, $lastname, $phonenumber, $city, $state, $zipcode, $dob, $doi, $adjustername, $claimrefnumber, $providernature, $created, $language, $client, $amountauthorized, $active, $invoiceformat); if($statement->execute()){ header("some location"); }else{ die('Error : ('. $mysqli->errno .') '. $mysqli->error); } $statement->close(); ?> ,它在其中执行另一个存储过程SP1

但是,当我运行查询来创建SP2时,我希望SP1不被执行。 SP2只应在执行SP2时执行。

这是疯了还是可以某种方式实现?

谢谢。

0 个答案:

没有答案