MySQL Forums
Forum List  »  Spanish

Re: Llamada de un procedimiento almacenado
Posted by: William Chiquito
Date: October 16, 2006 07:53AM

jesus,

No puede reproducir el error, ejecuté el siguiente script con la información enviada:

DROP TABLE IF EXISTS `cliente`;

CREATE TABLE `cliente` (
`idcliente` int(11) NOT NULL auto_increment,
`idfactura` int(11) NOT NULL,
PRIMARY KEY (`idcliente`,`idfactura`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci;

LOCK TABLES `cliente` WRITE;

insert into `cliente` (`idcliente`,`idfactura`) values (1,1);
insert into `cliente` (`idcliente`,`idfactura`) values (2,2);
insert into `cliente` (`idcliente`,`idfactura`) values (3,3);
insert into `cliente` (`idcliente`,`idfactura`) values (4,4);

UNLOCK TABLES;

DROP TABLE IF EXISTS `facturacliente`;

CREATE TABLE `facturacliente` (
`idclientef` int(11) NOT NULL,
`idfactura` int(11) default NULL,
PRIMARY KEY (`idclientef`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci;

LOCK TABLES `facturacliente` WRITE;

insert into `facturacliente` (`idclientef`,`idfactura`) values (1,1);
insert into `facturacliente` (`idclientef`,`idfactura`) values (2,2);
insert into `facturacliente` (`idclientef`,`idfactura`) values (3,3);

UNLOCK TABLES;

drop procedure if exists `spCargarFacturaCliente`;

DELIMITER $$

CREATE PROCEDURE `spCargarFacturaCliente`(IN codigo INT)
SQL SECURITY INVOKER
BEGIN
select *
from `FacturaCliente` fc, cliente c
where fc.idclientef = c.idcliente and fc.idfactura = codigo;
END$$

DELIMITER ;

call spCargarFacturaCliente(3);

idclientef idfactura idcliente idfactura
---------- --------- --------- ---------
3 3 3 3

¿Qué otra información me puedes enviar para ver que puede estar pasando?

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Llamada de un procedimiento almacenado
6836
October 16, 2006 07:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.