Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/04/2013, 17:13
unseo1989
 
Fecha de Ingreso: julio-2011
Ubicación: lima
Mensajes: 3
Antigüedad: 12 años, 9 meses
Puntos: 0
LLamar proc almacenado desde una conuslta mysql

HOlas tengo 2 procedimiento almacenados y una consulta ..desde esa consulta tengo ke llamar estos procediemntos almacenado y me sale error gracias ..por sus respuestas

me sale este error :

FUNCTION database.GetNameSecretary does not exist

esta es la consulta
Código MySQL:
Ver original
  1. SELECT ifnull(IDContact,'') as IDContact,
  2. ifnull(txtActualContact,'') as 'Actual Contact',
  3. ifnull(IDTitle,'') as idtitle ,
  4. ifnull(getCompleteName(txtLastName,txtFirstName),'') as 'Contact Name',
  5. ifnull(date(datDateSpokeWith),'') as 'Spoke Exec',
  6. ifnull(GetNameSecretary(IDContact),'') as ' Sec Name',
  7. ifnull(GetSpokeWithSecretary(IDContact),'') as 'Spoke Sec',
  8. date(datDateNoLongerEmployedbyCompany) as 'NoLonger',
  9. IDInterestLevel FROM tblcontact



este es el proc alamacenado 1

Código MySQL:
Ver original
  1. DELIMITER $$
  2.  
  3. CREATE DEFINER=`root`@`localhost` PROCEDURE `GetNameSecretary`(
  4.   IN `xstrIDContact` varchar(250)
  5. )
  6.     DECLARE xFirstName VARCHAR(50);
  7.   DECLARE xCount INTEGER;
  8.   SELECT xCount=COUNT(*) FROM tblSecretary WHERE IDContact=xstrIDContact GROUP BY IDContact;
  9.   IF xCount>1 then
  10.  
  11.     SELECT xFirstName = GetCompleteName(txtLastName,txtFirstName)
  12.         FROM tblSecretary WHERE intPriority=1 AND IDContact=xstrIDContact;
  13.   end if;
  14.   IF xCount=1 then
  15.  
  16.     SELECT xFirstName = GetCompleteName(txtLastName,txtFirstName)
  17.         FROM tblSecretary WHERE IDContact=xstrIDContact;
  18.   END if;
  19.    

y este es el segundo
Código MySQL:
Ver original
  1. DELIMITER $$
  2.  
  3. CREATE DEFINER=`root`@`localhost` PROCEDURE `GetSpokeWithSecretary`(
  4.   IN `xstrIDContact` varchar(250)
  5. )
  6.    
  7.   SELECT datDateSpokeWith FROM tblSecretary  
  8.     WHERE IDContact=xstrIDContact ORDER BY datDateSpokeWith desc;
  9.    

Última edición por gnzsoloyo; 10/04/2013 a las 03:59