Oracle Apex application items

Have you ever wanted to pass data to an applicatino process but are fed uphaving to use a temporary global variable like GV_TEMP, or similar as a temporary placeholder for some data you want to pass from the page in javascript?

var req = new htmldb_Get( null, 123, ‘APPLICATION_PROCESS=ap_dosomething’, 0 );

req.addParam( ‘GV_TEMP_VARIABLE’,’The value’ );

urgh..

Well you can use a built in APEX item instead, like this:

req.addParam( ‘x01’, ‘The value’ );

and in your application process, you can reference this value like this:

l_temp := wwv_flow.g_x01;

The advantage of this approach is that you dont have to declare an indefinite set of globals to act as a go-between for javascript and plsql, and you dont have to declare anything up front.

It’s also more clear, I think, that the variable is transitory and reusable.

Share

2 comments on this post.
  1. koloo:

    well you still have to use variables and declare them. Consider situation you are passing customername from page 1 to page2…thanks.

  2. Mark Caulfield:

    You are right, but I feel it just makes it a little less painful than setting up a load of temporary one-off meaningless variables. I use this method a lot when grabbing jSON data off a server, and need to pass an ID with it.

    Thans for your feedback.

Leave a comment