Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle v() vs nv() function

What is the difference between v() and nv() functions in oracle apex?

I came across the nv() function and the only thing I can get google to spit out is the nvl() function.

apex_custom_auth.post_login(   
                p_uname      => l_authenticated_username,  
                p_session_id => nv('APP_SESSION'),  
                p_app_page   =>
apex_application.g_flow_id||':'||nvl(apex_application.g_flow_step_id,0));
like image 235
BillyBarbarIan Avatar asked Oct 08 '19 18:10

BillyBarbarIan


People also ask

What is use of V SQL in Oracle?

V$SQL lists statistics on shared SQL areas without the GROUP BY clause and contains one row for each child of the original SQL text entered. Statistics displayed in V$SQL are normally updated at the end of query execution. However, for long running queries, they are updated every 5 seconds.

What is the use of NVL2 function in Oracle?

NVL2 lets you determine the value returned by a query based on whether a specified expression is null or not null. If expr1 is not null, then NVL2 returns expr2 . If expr1 is null, then NVL2 returns expr3 . The argument expr1 can have any datatype.

What is the difference between NVL and coalesce?

NVL and COALESCE are used to achieve the same functionality of providing a default value in case the column returns a NULL. The differences are: NVL accepts only 2 arguments whereas COALESCE can take multiple arguments. NVL evaluates both the arguments and COALESCE stops at first occurrence of a non-Null value.

What is V array Oracle?

Description The varray (variable size array) is one of the three types of collections in PL/SQL (associative array, nested table, varray). The varray's key distinguishing feature is that when you declare a varray type, you specify the maximum number of elements that can be defined in the varray.


2 Answers

nv returns a number rather than a string (so obviously it only works with numeric attributes). If you use v to return numeric values, you can sometimes run into performance issues related to data type conversion.

See Syntax for referencing item values

like image 113
Justin Cave Avatar answered Sep 22 '22 07:09

Justin Cave


It is

GET_NUMERIC_SESSION_STATE Function

This function returns a numeric value for a numeric item. You can use this function in Oracle Application Express applications wherever you can use PL/SQL or SQL. You can also use the shorthand, function NV, in place of APEX_UTIL.GET_NUMERIC_SESSION_STATE.

See Oracle Application Express APIs for more info.

like image 28
Littlefoot Avatar answered Sep 22 '22 07:09

Littlefoot