ora2pg icon indicating copy to clipboard operation
ora2pg copied to clipboard

Conversion function matched incorrectly inside function name

Open Torquem opened this issue 9 years ago • 2 comments

If user function contains known conversion function name, it is converted even though it is part of another function name. The function parameter must match the conversion function's parameter.

Steps to reproduce: CREATE FUNCTION FOO_TO_NUMBER(str IN VARCHAR2) RETURN NUMBER IS BEGIN RETURN 1; END; / CREATE VIEW FOO AS SELECT FOO_TO_NUMBER('1') TMP FROM DUAL;

ora2pg -t VIEW returns: CREATE OR REPLACE VIEW foo (tmp) AS SELECT FOO_('1')::numeric TMP;

Work aroud: Rename function ;)

Torquem avatar Oct 13 '17 06:10 Torquem

Thanks for the report, commit c3f1706 might fix it.

darold avatar Oct 13 '17 12:10 darold

That was fast!

Verified to work in master e4437d5.

Thank you!

Torquem avatar Oct 16 '17 07:10 Torquem