-- MySQL dump 10.10 -- -- Host: localhost Database: dbt2wsp -- ------------------------------------------------------ -- Server version 5.0.6-beta-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `dbsp1` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `dbsp1`; -- -- Table structure for table `order_line` -- DROP TABLE IF EXISTS `order_line`; CREATE TABLE `order_line` ( `ol_o_id` int(11) NOT NULL default '0', `ol_d_id` int(11) NOT NULL default '0', `ol_w_id` int(11) NOT NULL default '0', `ol_number` int(11) NOT NULL default '0', `ol_i_id` int(11) default NULL, `ol_supply_w_id` int(11) default NULL, `ol_delivery_d` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `ol_quantity` double default NULL, `ol_amount` double default NULL, `ol_dist_info` varchar(24) default NULL, PRIMARY KEY (`ol_w_id`,`ol_d_id`,`ol_o_id`,`ol_number`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `order_line` -- /*!40000 ALTER TABLE `order_line` DISABLE KEYS */; LOCK TABLES `order_line` WRITE; INSERT INTO `order_line` VALUES (3000,8,1,1,301,1,'0000-00-00 00:00:00',5,4567.44,'QRtxgfiXDWIYnbJOmhrmTKgn'),(3000,8,1,2,91825,1,'0000-00-00 00:00:00',5,9842.07,'imvJcmDaUJjRMfakTbTHOCya'),(3000,8,1,3,44701,1,'0000-00-00 00:00:00',5,5269.76,'jXDyHPUpsISscBcTNitYCVRK'),(3000,8,1,4,38725,1,'0000-00-00 00:00:00',5,7728.81,'jPsqyRtxxjrNCAfuCHxWtgpS'),(3000,8,1,5,60501,1,'0000-00-00 00:00:00',5,7190.74,'SVdCfsuWRlRojahWchcwkjUH'); UNLOCK TABLES; /*!40000 ALTER TABLE `order_line` ENABLE KEYS */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; drop procedure if exists order_status1; delimiter // CREATE PROCEDURE order_status1 (in_c_id INT) BEGIN DECLARE out_c_first TEXT; DECLARE out_c_middle char(2); DECLARE out_c_balance NUMERIC; DECLARE out_o_id INT; DECLARE out_o_carrier_id INT; DECLARE out_o_entry_d VARCHAR(28); DECLARE out_o_ol_cnt INT; DECLARE out_ol_supply_w_id1 INT; DECLARE out_ol_i_id1 INT; DECLARE out_ol_quantity1 INT; DECLARE out_ol_amount1 NUMERIC; DECLARE out_ol_delivery_d1 VARCHAR(28); DECLARE out_c_id INT; DECLARE out_c_last VARCHAR(255); declare rc int default 0; declare c cursor for SELECT ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_delivery_d FROM order_line WHERE ol_w_id = 1 AND ol_d_id = 8 AND ol_o_id = 3000; declare continue handler for sqlstate '02000' set rc = 1; open c; fetch_block: BEGIN fetch c into out_ol_i_id1, out_ol_supply_w_id1, out_ol_quantity1, out_ol_amount1, out_ol_delivery_d1; if rc then leave fetch_block; end if; end fetch_block; close c; END // delimiter ;