Joder, me haceis currar leñe ¡¡¡¡¡¡
Mira, aparte de que tienes que cambiar el OR por un AND el error es este :
raise_application_error(-2001,'que es esoooooo?');
Fijate :
Cita: sql plus > select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
5 filas seleccionadas.
real: 47
sql plus > CREATE TABLE "BOLETO"
2 ( "SEXO" VARCHAR2(1)
3 )
4 /
Tabla creada.
real: 31
sql plus > create or replace procedure "INSERTA_BOLETO"
2 (sexo boleto.sexo%type)
3 is
4 begin
5 if sexo<>('f') or sexo <>('m')then
6 raise_application_error(-2001,'que es esoooooo?');
7 else
8 insert into boleto values (sexo);
9 end if;
10 end "INSERTA_BOLETO";
11 /
Procedimiento creado.
real: 32
sql plus > execute "INSERTA_BOLETO"('m');
begin "INSERTA_BOLETO"('m'); end;
*
ERROR en línea 1:
ORA-21000: error number argument to raise_application_error of -2001 is out of range
ORA-06512: at "desarrollo.INSERTA_BOLETO", line 6
ORA-06512: at line 1
real: 0
sql plus > create or replace procedure "INSERTA_BOLETO"
2 (sexo boleto.sexo%type)
3 is
4 begin
5 if sexo<>('f') or sexo <>('m')then
6 raise_application_error(-20001,'que es esoooooo?');
7 else
8 insert into boleto values (sexo);
9 end if;
10 end "INSERTA_BOLETO";
11 /
Procedimiento creado.
real: 47
sql plus > execute "INSERTA_BOLETO"('m');
begin "INSERTA_BOLETO"('m'); end;
*
ERROR en línea 1:
ORA-20001: que es esoooooo?
ORA-06512: at "desarrollo.INSERTA_BOLETO", line 6
ORA-06512: at line 1
real: 47
sql plus > insert into boleto values('m');
1 fila creada.
real: 31
sql plus > commit;
Validación terminada.
real: 31
sql plus > execute "INSERTA_BOLETO"('m');
begin "INSERTA_BOLETO"('m'); end;
*
ERROR en línea 1:
ORA-20001: que es esoooooo?
ORA-06512: at "desarrollo.INSERTA_BOLETO", line 6
ORA-06512: at line 1
real: 47
sql plus > create or replace procedure "INSERTA_BOLETO"
2 (sexo boleto.sexo%type)
3 is
4 begin
5 if sexo<>('f') AND sexo <>('m')then
6 raise_application_error(-20001,'que es esoooooo?');
7 else
8 insert into boleto values (sexo);
9 end if;
10 end "INSERTA_BOLETO";
11 /
Procedimiento creado.
real: 47
sql plus > execute "INSERTA_BOLETO"('m');
Procedimiento PL/SQL terminado con éxito.
real: 31
sql plus > drop table boleto purge;
Tabla borrada.
real: 46
sql plus > drop procedure "INSERTA_BOLETO";
Procedimiento borrado.
real: 156
sql plus >