How can Oracle Apex obtain URL parameters?

In Oracle Apex, you can use the APEX_UTIL.GET_URL_PARAMETER function to retrieve URL parameters.

The following is an example demonstrating how to retrieve the URL parameter “p_id”.

DECLARE
  l_id NUMBER;
BEGIN
  l_id := APEX_UTIL.GET_URL_PARAMETER('p_id');
  -- 在此处可以使用l_id进行后续处理
END;

In this example, the GET_URL_PARAMETER function will retrieve the value of the parameter named “p_id” in the URL and assign it to the l_id variable.

Please note that the GET_URL_PARAMETER function can only be used to retrieve URL parameters during page load. If you need to retrieve URL parameters in other parts of the page or through other means, you can use the APEX_APPLICATION.G_F01 to G_F50 collection to retrieve the parameters. For example, you can use the following code to retrieve a URL parameter named “p_id”:

DECLARE
  l_id NUMBER;
BEGIN
  l_id := APEX_APPLICATION.G_F01;
  -- 在此处可以使用l_id进行后续处理
END;

In this example, the G_F01 collection corresponds to the values of the URL parameters. It is important to note that the G_F01 to G_F50 collections are all of type VARCHAR2, so if the URL parameters are numerical, a type conversion is necessary.

bannerAds