problemas al crear función
Publicado por rookie (8 intervenciones) el 08/04/2002 12:55:25
Tengo problemas al crear la siguiente función:
create function insCliente(bpchar, bpchar, bpchar, bpchar)
returns int4
as
'insert into Clientes(RUT, Nombre, Comuna, Direccion) values ($1, $2, $3, $4);
select CAST(count(*) as int4) from Clientes where RUT=$1;'
LANGUAGE 'sql';
Cuando trato de crear la función me aparece el siguiente error:
ERROR: Unable to identify an operator '=$' for types 'bpchar' and 'int4'
You will have to retype this query using an explicit cast (State:S1000, Native Code: 7)
El error se produce por el where en el select, pero no sé exactamente por qué ni cómo solucionarlo.
Gracias
create function insCliente(bpchar, bpchar, bpchar, bpchar)
returns int4
as
'insert into Clientes(RUT, Nombre, Comuna, Direccion) values ($1, $2, $3, $4);
select CAST(count(*) as int4) from Clientes where RUT=$1;'
LANGUAGE 'sql';
Cuando trato de crear la función me aparece el siguiente error:
ERROR: Unable to identify an operator '=$' for types 'bpchar' and 'int4'
You will have to retype this query using an explicit cast (State:S1000, Native Code: 7)
El error se produce por el where en el select, pero no sé exactamente por qué ni cómo solucionarlo.
Gracias
Valora esta pregunta
![Me gusta: Está pregunta es útil y esta clara Me gusta: Está pregunta es útil y esta clara](/img/img.png?11.51)
![NO me gusta: Está pregunta no esta clara o no es útil No me gusta: Está pregunta no esta clara o no es útil](/img/img.png?11.51)
0