This is my code
Create database OfertaEmpleo
use OfertaEmpleo
go
Create table OfertaTrabajo
(
Nombre Varchar (100),
Titulo Varchar (100),
Tipo Varchar (100),
Ubicacion Varchar (200),
Salario int,
Requerimientos varchar (200)
);
go
create proc sp_listar_clientes
as
Select* from OfertaTrabajo order by Nombre
go
create proc sp_buscar_clientes
@Nombre Varchar (100)
as
select Nombre,Titulo,Tipo,Ubicacion,Salario,Requerimientos from OfertaTrabajo where Nombre like @Nombre + '%'
go
create proc sp_mantenimiento_clientes
@Nombre Varchar (100),
@Titulo Varchar (100),
@Tipo Varchar (100),
@Ubicacion Varchar (200),
@Salario int,
@Requerimientos varchar (200),
@accion varchar (100) output
as
if (@accion = '1')
begin
declare @NomNuevo varchar(100), @Nommax varchar (100)
set @Nommax = (select max (Nombre) from OfertaTrabajo)
set @Nommax = isnull(@Nommax,'A0000')
set @NomNuevo = 'A'+RIGHT(RIGHT(@Nommax,6)+10001,6)
insert into OfertaTrabajo(Nombre,Titulo,Tipo,Ubicacion,Salario,Requerimientos)
values (@NomNuevo,@Nombre,@Titulo,@Tipo,@Ubicacion,@Salario,@Requerimientos)
set @accion= 'Se genero el Nombre:'+@NomNuevo
end
else if(@accion='2')
begin
update OfertaTrabajo set Titulo=@Titulo, Tipo=@Tipo, Ubicacion=@Ubicacion, Salario=@Salario, Requerimientos= @Requerimientos where Nombre=@Nombre
set @accion='Se Modifico el Nombre:'+ @Nombre
end
else if (@accion='3')
begin
Delete from OfertaTrabajo where Nombre=@Nombre
set @accion = 'Se borro el Nombre;'+@Nombre
end
go
and I'm getting this error:
Msg 110, Level 15, State 1, Procedure sp_mantenimiento_clientes, Line 17 [Batch Start Line 27]
There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
What I have tried:
I did count the columns and are the same