-- Stored Procedure
DROP PROCEDURE IF EXISTS trainee.productpricing;
CREATE PROCEDURE trainee.productpricing()
BEGIN
SELECT Name FROM trainee.City;
END;
DROP PROCEDURE IF EXISTS trainee.siva_sp_ucallist;
CREATE PROCEDURE trainee.siva_sp_ucallist(IN vUserId INT )
COMMENT 'List the user information like team,child,user playing team'
BEGIN
SELECT plg_team.team_name,0 FROM plg_team WHERE plg_team.team_user_id=vUserId;
END;
-- Function
DROP FUNCTION IF EXISTS trainee.fun_grosspay;
CREATE FUNCTION trainee.fun_grosspay(pmid INT) RETURNS decimal(10,2)
BEGIN
DECLARE vBasic , vIncr , vNetPay DECIMAL(10,2);
SELECT emps_basicpay , emps_increment INTO vBasic , vIncr FROM trne_emp_salary WHERE emps_generated_id = pmid;
SET vNetPay = vBasic + vIncr ;
RETURN vNetPay ;
# SELECT fun_grosspay(101);
END;
-- View
CREATE OR REPLACE VIEW viw_name AS
SELECT column_name from tab_name;
No comments:
Post a Comment