Re: Passing values between stored procedures
how can i do to compare an IN parameter in a 'select where' sentences.
this is the code
CREATE PROCEDURE insertOpe (
--- CLIENTE TABLE
IN id_var INT,
---para la tabla OPERADOR
IN user_var char(10),
IN password_var INT(11),
OUT message VARCHAR(20))
BEGIN
---DECLARE count INT DEFAULT 0;
DECLARE V1 INT DEFAULT 0;
DECLARE exit handler for 1062 rollback;
set message := "Error";
start transaction;
select count(*)into v1 from operador op where
(op.dni=id_var); <----------------------------- HERE. It is rigth?
if (v1>0)then
set message := "op exist";
rollback;
else
insert Operador (user,password,dni)
select user_var,password_var,id_var;
commit;
set message := "OK";
end if;
END/
Subject
Views
Written By
Posted
7760
October 05, 2005 02:28AM
2347
October 05, 2005 03:33AM
Re: Passing values between stored procedures
2497
October 05, 2005 01:56PM
2244
October 05, 2005 04:47AM
2052
October 05, 2005 06:22AM
2010
October 10, 2005 04:41PM
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.