Troubleshoot ORA-00938: ORA-00939: not enough arguments & too many arguments for function

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
Reason:
This error is related to the oracle functions. For each and every function there should be well defined set of arguments. If you miss to specify the exact number of arguments, you will get these errors. In case if you are specifying less number of arguments you get ORA-00938: not enough arguments for the function and if you specify more number of arguments to a function you will get ORA-00939: too many arguments for function.
Please find some examples below with function substr.
Example:

SQL> select substr('Oracle database') from dual;
select substr('Oracle database') from dual
       *
ERROR at line 1:
ORA-00938: not enough arguments for function


SQL> select substr('Oracle database',3,3,3) from dual;
select substr('Oracle database',3,3,3) from dual
                                    *
ERROR at line 1:
ORA-00939: too many arguments for function

Substr function with proper syntax:
SQL> select substr('Oracle database',3,3) from dual;

SUB
---
acl

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer