From ce74ce45e2c61695f98fab012efc615ffaac7f78 Mon Sep 17 00:00:00 2001 From: Gopi Katwala Date: Thu, 4 Jul 2019 22:07:30 -0400 Subject: [PATCH] Fixed a DB function, renamed a stored proc Fixed a typo --- .../sales-order/sales-order.component.html | 2 +- AstuteSystem/sql/astute.sql | 23 ++++++------------- .../src/main/java/com/astute/dao/DAO.java | 2 +- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/AstuteClient2/src/app/sales-order/sales-order.component.html b/AstuteClient2/src/app/sales-order/sales-order.component.html index b39232d..d68fe3c 100644 --- a/AstuteClient2/src/app/sales-order/sales-order.component.html +++ b/AstuteClient2/src/app/sales-order/sales-order.component.html @@ -67,7 +67,7 @@ SO Title - + SO Number diff --git a/AstuteSystem/sql/astute.sql b/AstuteSystem/sql/astute.sql index 3ac8be4..a31ffc1 100644 --- a/AstuteSystem/sql/astute.sql +++ b/AstuteSystem/sql/astute.sql @@ -60,15 +60,15 @@ END; -- Dumping structure for function astute.create_customer_fun DELIMITER // -CREATE DEFINER=`root`@`localhost` FUNCTION `create_customer_fun`(customerid varchar(20), customerName varchar(100), billToDept varchar(100), add1In varchar(100), add2In varchar(100), cityIn varchar(50), stateIn varchar(20), zipIn int(5), zipLast4In int(4), emailIn varchar(50), phoneIn varchar(20), faxIn varchar(20)) RETURNS varchar(20) CHARSET utf8 +CREATE FUNCTION astute.`create_customer_fun`(customerid varchar(20), customerName varchar(100), billToDept varchar(100), add1In varchar(100), add2In varchar(100), cityIn varchar(50), stateIn varchar(20), zipIn int(5), zipLast4In int(4), emailIn varchar(50), phoneIn varchar(20), extIn int(6), faxIn varchar(20)) RETURNS varchar(20) CHARSET utf8 BEGIN DECLARE last_inserted_id varchar(20); -INSERT INTO customer (customer_id, customer_name, bill_to_dept, add1, add2, city, state ,zip, zip_last_4, email, phone, fax) -VALUES (customerid, customerName, billToDept, add1In, add2In, cityIn, stateIn, zipIn, ziplast4In, emailIn, phoneIn, faxIn); +INSERT INTO customer (customer_id, customer_name, bill_to_dept, add1, add2, city, state ,zip, zip_last_4, email, phone, phext, fax) +VALUES (customerid, customerName, billToDept, add1In, add2In, cityIn, stateIn, zipIn, ziplast4In, emailIn, phoneIn, extIn, faxIn); SELECT LAST_INSERT_ID() into last_inserted_id; return last_inserted_id; -END// -DELIMITER ; +END; + -- Dumping structure for procedure astute.create_invoice DELIMITER // @@ -179,9 +179,9 @@ INSERT INTO `customer_contact` (`customer_id`, `contact_id`, `name`, `title`, `w ('MDOT', 2, 'John John', 'Manager', '1231231233', 1233, '1232343455', '234123344', 'Test@Test.com', '123 Test Drive'); /*!40000 ALTER TABLE `customer_contact` ENABLE KEYS */; --- Dumping structure for function astute.delete_custmer +-- Dumping structure for function astute.delete_customer DELIMITER // -CREATE DEFINER=`root`@`localhost` FUNCTION `delete_custmer`(customer_id_in varchar(20)) RETURNS varchar(40) CHARSET utf8 +CREATE DEFINER=`root`@`localhost` FUNCTION `delete_customer`(customer_id_in varchar(20)) RETURNS varchar(40) CHARSET utf8 BEGIN DECLARE po_count int; @@ -202,15 +202,6 @@ BEGIN END// DELIMITER ; --- Dumping structure for function astute.delete_custmer_contact -DELIMITER // -CREATE DEFINER=`root`@`localhost` FUNCTION `delete_custmer_contact`(customer_id_in varchar(20), customer_contact_id int) RETURNS varchar(40) CHARSET utf8 -BEGIN - delete from customer_contact where customer_id = customer_id_in and contact_id = customer_contact_id; - RETURN 'SUCCESS'; -END// -DELIMITER ; - -- Dumping structure for function astute.delete_customer_contact DELIMITER // CREATE DEFINER=`root`@`localhost` FUNCTION `delete_customer_contact`(customer_id_in varchar(20), contact_id_in int) RETURNS varchar(20) CHARSET utf8 diff --git a/AstuteSystem/src/main/java/com/astute/dao/DAO.java b/AstuteSystem/src/main/java/com/astute/dao/DAO.java index 6b01957..5b25b55 100644 --- a/AstuteSystem/src/main/java/com/astute/dao/DAO.java +++ b/AstuteSystem/src/main/java/com/astute/dao/DAO.java @@ -60,7 +60,7 @@ public abstract class DAO { host = "localhost"; port = 3306; schema = "astute"; - username = "astute_user"; + username = "root"; password = "password"; System.out.println("============================================="); System.out.println("host is " + host);