Wednesday 17 February 2016

v('') Vs. apex_application.globalvariable

As i describe in Previous post their are list of global variable which we can use in pl/sql aslo.
Now, Problem is v(' '); is not fix oracle apex may change it in future as they have done it in past so better approach will be use it as apex_application.globalvariable for that i have created a Function as shown below(change it as per need).

Function :

CREATE OR REPLACE FUNCTION GET_CUSTOMERNAME(custid Number) RETURN VARCHAR2 IS
tmpVar VARCHAR2(200);

BEGIN
 
     SELECT FIRST_NAMEINTO tmpVar FROM CUSTOMER WHERE CUST_ID = custid
   and cmp_id = apex_application.g_user;
   RETURN tmpVar;
   EXCEPTION
     WHEN NO_DATA_FOUND THEN
       NULL;
     WHEN OTHERS THEN
       -- Consider logging the error and then re-raise
       RAISE;
END GET_CUSTOMERNAME;
/

No comments:

Post a Comment

Show values in right side of shuttle

While working with select list and shuttle, when we want to display values into right side of shuttle depending upon selection from select ...