0
I’m trying to make a function inside the sql server, however, I can not use it because of an error saying that the result consists of more than one line (Error Code: 1172 Result consisted of more than one Row) I wonder how I can solve this
`CREATE FUNCTION `retornaSolo`(id int(11)) RETURNS varchar(80) CHARSET latin1
BEGIN
declare solos varchar (80);
select tipo_solo into solos from solo where status_solo = 'Ativado'
and cod_usuario = id;
RETURN solos;
END`
what do you want to return with the function ? just one data ? several data ? a table ?
– Rovann Linhalis
http://tsqlmaster.blogspot.com.br/2013/05/criando-umaprocedure-com-cursor-no.html .... This"into" allows the return of only one value , your select "activated" should return more than one line , read on cursors.
– Motta
i intend to return various data, which in case would be all types of soils registered by the user
– Leonardo