Monday, February 17, 2014

Sql procedure to read data from mySQL DB

Learning :


mysql procedure to get the data from a table
************************************************************
DELIMITER $$
DROP PROCEDURE IF EXISTS sp_transpose_tickets $$
CREATE PROCEDURE sp_transpose_tickets ()
BEGIN
    select eladm.DiagnosisCode,eladm.PatientID from admission eladm;
END$$
DELIMITER ;





************************************************************
where admission== tableName


to see what is stored
*******************************
call sp_transpose_tickets()
*******************************