Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

while using MOD in oracle sql, i am getting error

This is my code-
code

error-
number or types of arguments are calling =

i think it’s a syntax error. i am getting same error in most of my codes

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Wrong syntax.

SQL> CREATE OR REPLACE FUNCTION comparisonlike (g IN VARCHAR2)
  2     RETURN VARCHAR2
  3  AS
  4  BEGIN
  5     RETURN CASE WHEN MOD (g, 2) = 0 THEN 'EVEN' ELSE 'ODD' END;
  6  END;
  7  /

Function created.

SQL> select comparisonlike(25) result from dual;

RESULT
--------------------
ODD

SQL> select comparisonlike(12) result from dual;

RESULT
--------------------
EVEN

SQL>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading