diff --git a/AstuteSystem/sql/astute.sql b/AstuteSystem/sql/astute.sql index 67cb7f0..271eaf3 100644 --- a/AstuteSystem/sql/astute.sql +++ b/AstuteSystem/sql/astute.sql @@ -67,7 +67,7 @@ DELIMITER // CREATE DEFINER=`root`@`localhost` PROCEDURE `create_po`(PONum varchar(40), contractNum varchar(20), PODate date, contractAmt double(10,2), customerid int, astute_project_num_in varchar(20)) BEGIN DECLARE next_po_id int(11); -SELECT MAX(po_id) + 1 INTO next_po_id FROM PO; +SELECT MAX(po_id) + 1 INTO next_po_id FROM PO WHERE contract_num = contractNum; INSERT INTO PO (po_id, PO_num, contract_num, PO_date, contract_amt, customer_id,astute_project_num) VALUES (next_po_id, PONum, contractNum, PODate, contractAmt, customerId,astute_project_num_in); END// @@ -424,7 +424,7 @@ INSERT INTO `service_type` (`service_type_id`, `desc`) VALUES -- Dumping structure for table astute.session CREATE TABLE IF NOT EXISTS `session` ( - `session_id` varchar(500) NOT NULL, + `session_id` varchar(200) NOT NULL, `user_id` int(11) NOT NULL, `session_start_date` date DEFAULT NULL, `session_end_date` date DEFAULT NULL,