cancel
Showing results for 
Search instead for 
Did you mean: 

Round function overload

Round function overload

Hello,

 

I am doing EDB Postrgres migration portal. I saw that because of my structure of databese none of calls in views for function ROUND works (Acording to documentation ROUND(NUMERIC, INTEGER). So I wrote function:

 

CREATE OR REPLACE FUNCTION MINERVA.ROUND
(
  N IN NUMBER
, D IN NUMBER
) RETURN NUMBER
AS
	tmp INTEGER;
    tmp2 NUMBER;
BEGIN
	TMP:=TRUNC(D,0);
	tmp2:= round(N, TMP);
  RETURN TMP2;
END ROUND;
/

And for that i get errors:

- Incompatible expression found line 1, char 35

- Error in syntax recognition line 13, char 4

 

I guess because of name. So I tryed diferent name:

CREATE OR REPLACE FUNCTION MINERVA.EDB_ROUND
(
  N IN NUMBER
, D IN NUMBER
) RETURN NUMBER
AS
	tmp INTEGER;
    tmp2 NUMBER;
BEGIN
	TMP:=TRUNC(D,0);
	tmp2:= round(N , TMP);
  RETURN TMP2;
END EDB_ROUND;
/

And here I got error:

- Incompatible NUMERIC function line 11, char 18

 

Don't understand what is wrong. I tryed all typecasting found in documentation and nothing helps.

 

any ideas welcome. thank you, Marko

View Entire Topic
chaitalirs
EDB Team Member

Hi mhorvat81,

 

We have a new release for "EDB Migration Portal 2.3.0".

 

https://postgresrocks.enterprisedb.com/t5/EDB-Technical-Updates-and-Alerts/Technical-Update-for-EDB-...

 

This release has the resolution for your reported issue on this thread. Please test and let us know your feedback.

Ask a Question
Top Kudoed Posts