Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql

--
-- Procedures
--
CREATE DEFINER=`root`@`localhost` PROCEDURE `business_registration` (IN `bscode` VARCHAR(10), IN `bsname` VARCHAR(50), IN `appcode` VARCHAR(10), IN `in_state` VARCHAR(25), IN `in_sector` VARCHAR(50), IN `in_cac` VARCHAR(10), IN `dobinc` DATE, IN `fname` VARCHAR(100), IN `phone` VARCHAR(20), IN `in_email` VARCHAR(20), IN `biz_add` VARCHAR(50), IN `app_status` VARCHAR(10), IN `in_id` INT, IN `query_type` VARCHAR(30))  NO SQL
Begin
if query_type="insert" THEN
INSERT INTO `business_registration`(`business_code`, `business_name`, `application_code`, `state`, `sector`, `cac_registration`, `date_of_biz_incorporation`, `founders_name`, `phone_number`, `email`, `biz_address`, `application_status`) VALUES (bscode,bsname,appcode,in_state,in_sector,in_cac,dobinc,fname,phone,in_email,biz_add,app_status);

ELSEIF query_type="delete" THEN
DELETE FROM business_registration where id=in_id;

ELSEIF query_type="select_all" THEN
SELECT * FROM business_registration;

ELSEI[...]
Source by localhost #
 
PREVIOUS NEXT
Tagged: #sql
ADD COMMENT
Topic
Name
4+8 =