<div>Hello everybody, I want to do a function that receives as param two points and returns a box3d from this points, I have tried but I can't do it.</div>
<div>This is my function</div>
<div>---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div>
<div>CREATE OR REPLACE FUNCTION getprueba1("numeric", "numeric")<br>  RETURNS BOX3D AS<br>$BODY$   <br>BEGIN<br>RETURN 'BOX3D('||($1-100)::VARCHAR ||' '||($2-100)::varchar||','||($1+100)::VARCHAR||' '||($2+100)::varchar||')'::BOX3D;
<br>END;<br>$BODY$<br>LANGUAGE 'plpgsql' VOLATILE;<br>ALTER FUNCTION getprueba1("numeric", "numeric") OWNER TO postgres;</div>
<div>----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div>
<div>This is the error</div>
<div> </div>
<div>ERROR:  BOX3D parser - doesnt start with BOX3D(<br>CONTEXT:  SQL statement "SELECT  'BOX3D('||( $1 -100)::VARCHAR ||' '||( $2 -100)::varchar||','||( $3 +100)::VARCHAR||' '||( $4 +100)::varchar||')'::BOX3D"
<br>PL/pgSQL function "getprueba1" line 3 at return<br>---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
</div>
<div>can anybody help me, I can't find where is the error, If I do the same with a literal string this works, but when I use the pipe for concat strings this doesnt work.</div>
<div> </div>