Truth behind show user

SQLPLUS command line provides a show user help which can print which user you are logged in as. Just learned new today that it is not hitting the DB to get the results.

Tom, who else can bring it to light. I am just 12 years down the line to have read his message.

The content points to this article

The SQLPLUS caches the username as soon as a "connection" is established and saves it for reuse. Whenever somebody issues a show user, it just returns from the cache.

Internally for the first time it will be doing a select user from dual; to set the value. Its like a global variable

Next time onwards it will simply return from its variable instead of running a query. Even if the Connection is killed, SQLPLUS returns the variable value. (This was new to me)

----Copy pasting shamelessly the example from Tom Kyte's article for my reference:
[tkyte@desktop tkyte]$ sqlplus /
 
SQL*Plus: Release 10.1.0.4.0 - Production on Wed Aug 3 10:01:01 2005
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
With the Partitioning, OLAP and Data Mining options
 
ops$tkyte@ORA10G> @getspid
 
DEDICATED_SE CLIENTPID
------------ ------------
8391         8389
 
ops$tkyte@ORA10G> !kill -9 8391
 
ops$tkyte@ORA10G> show user
USER is "OPS$TKYTE"
ops$tkyte@ORA10G> select user from dual;
select user from dual
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
 
 
ERROR:
ORA-03114: not connected to ORACLE

 
 
ops$tkyte@ORA10G> show user
USER is "OPS$TKYTE"
ops$tkyte@ORA10G>

Reports Builder wont open in Windows 10 64bit - [SOLVED]

Though Oracle doesn't support Forms 10g in Windows 10: 64 bit, I had installed it and was working till last month. Then suddenly one fine day, the report builder window won't show up. Though it was running in the task bar, I couldnt do anything with it. Forms builder was working properly.

Then taking cue from this Oracle form community post, I copied the cauprefs.ora from my colleague. Boom, the Report builder started to show up.

Then spend some time analyzing changes of the backup file with my file obtained from my colleague. It showed differences in the section where x, y coordinates were saved for Reports preferences.

====cauprefs.ora Backup file (Report Builder not opening)
Reports.root_ht = 725
Reports.root_max = No
Reports.root_wd = 1333
Reports.root_x = "-32000"
Reports.root_y = "-8"
Reports.root_y = "-32000"


====cauprefs.ora from my colleague (Report Builder opening properly)
Reports.root_ht = 725
Reports.root_max = No
Reports.root_wd = 1333
Reports.root_x = "-8"
Reports.root_y = "-8"
Reports.root_y = 0

The highlighted lines were causing the problem, and once replaced my problem is solved.

Reuse and Show Apex's Wait Popup

Oracle Apex supports or offers a GIF image and an overlay while loading content using Dynamic Action/AJAX. While creating a dynamic action you have an option to select "Show Processing" for supported actions.

This shows a nice overlay over the screen and a GIF image out of the box. You may have scenarios to show a loading while doing some javascript/jquery actions on your own.

Will it not be nice to show/reuse the same overlay and image?

This article explains how to do it.

Say you have a function to load data from server and show on page using a javascript function:

function previewFiles(){
  ajax.widget.waitPopup();
}

The above javascript call will show the overlay and GIF image. This is very simple isn't it. But to hide it, there is no function. We have to call following jquery method calls.

$("#apex_wait_popup").remove();  
$("#apex_wait_overlay").remove();

Which will remove the popup and overlay from DOM. To simplify things we will create this as a javascript function and save in one's library.

function hideWaitPopup(){
  $("#apex_wait_popup").remove();  
  $("#apex_wait_overlay").remove();
}

Then simply call hideWaitPopup(); inside your javascript function to hide the popup and overlay.