DECODE function in oracle

DECODE Function  DECODE Function is an oracle database conditional function and has more than three parameters. The function returns different values based on the values of the comparison condition parameter. The syntax for DECODE Function is: DECODE(expr1,comp1, iftrue1,[comp2,iftrue2…[ compN , iftrueN]], [iffalse]) if the value of the ‘expr1’ and ‘comp1’ parameters are equal, the function […]

COALESCE Function of oracle database

COALESCE Function COALESCE Function is an oracle database function and has many parameters. The function returns the first parameter from the list that has nonnull value. The syntax for COALESCE Function is : COALESCE(expr1, expr2,…,exprn) The value of the ‘expr1‘ parameter above is returned if it is not null, unless the value of the ‘expr2‘ […]

NULLIF oracle

NULLIF Function NULLIF Function has  two parameters and checks whether the value of these two parameters are equal or not. The syntax  is : NULLIF(ifunequal, comparision_term) If the ‘ifunequal‘ parameter value  and the ‘comparision_term‘ parameter  value are equal,  the function returns NULL value unless it returns the ‘ifunequal’ parameter value. Example: Connect to your oracle […]

NVL2 oracle

NVL2 Function NVL2 oracle function checks whether the data type of a column or expression is null or not. The syntax for NVL2 oracle function is: NVL2(original, ifnotnull,  ifnull) If the value of the ‘original’  parameter is not null, the function returns the value of  the ‘ifnotnull’ parameter unless  the function returns the value of […]

The DEFINE command

The DEFINE  command Oracle define command enables us to define  and create session level variables. when we select and run  SQL statements,  these session variables are referenced using double ampersand substitution(&&). Before defining and creating these variables, we have to make sure that the oracle SQL client tools such as SQL*PLUS and SQL developer ,that […]

The DESCRIBE command for table

DESCRIBE command DESCRIBE SQL table command in oracle database enables us to view or display the structure of a table.  And we can run this command using oracle client tools such as SQL*PLUS  and SQL developer. SQL*PLUS is a client tool which will be installed by default when we install and create oracle database software […]