Tuesday, March 31, 2009

Fishing Questions

In this section I will list out some of the questions which may be very easy but difficult to get remember sometimes. The purpose is to easy bookmark this page for future reference. Questions will be related to Apex, AJAX, .Net or any other technical questions. Let us Start....

1.Do you know you can edit data grid in Toad.
Yes, Toad for Oracle, SQL Server or DB2 displays queried data in grid. The displayed grid itself is editable. It will be editable only if you query data with rowid.
for example: select empid,name from emptbl does not give you editable grid. but of course, select rowid,empid,name from emptbl will give you editable grid. And also you will have BLOB editor if you select BLOB column. you can access BLOB editor by double clicking on BLOB cell. If Cell is not empty then it will display HUGE BLOB in capital letters.

2. How to hide column from exporting in APEX?Some people are using two different report regions: One for displaying report and One for exporting report to excel. There is a very easy way to prevent column from exporting to excel sheet in APEX. Just put following condition on column.

Set Condition to PLSQL Expression and put WWV_FLOW.g_excel_format = false in Expression1 textarea.
This will display column to user but It would not get exported while user will select "Export to Excel"

3. Reason for "ORA-30926: unable to get a stable set of rows in the source tables"

Cause
A stable set of rows could not be got because of large DML activity or a non-deterministic where clause.
Action
Remove any non-deterministic where clauses and reissue the DML.

Other Comments :
Of course the problem is with "non-deterministic where clause." but in case of merge statement your where clause will be condition after "On" ..

i.e. merge into tab1 using (inner query) on (this is your where clause)

so if you are using result from "inner query" as a column in your comparison then it should be deterministic by oracle engine. Most of the time duplicates values will also be the cause of this problem.

for example:
------------------
merge into tabw w
using (select upper (name) as user_name
from tab2) inner_query
on (w.user_name = inner_query.user_name)
when matched then
update
set w.assignee = 'Y'

in this case your inner_query
"select upper (name) as user_name from tab2" should not return duplicate values.


4. Strange behavior of keyboard  on Remote Desktop Connection. Pressing key 'E' opens "Windows Explorer"

Cause
It assumes that you have pressed logo key on your keyboard.  when you press E, it fires keyboard shortcuts for windows explorer.
Action
Press logo key twice slowly and one by one. If this does not resolve your problem, Lock your computer by pressing logo key + L and unlock again.

Other Comments :
It is a known defect of microsoft windows. It assumes that you have pressed logo key on your keyboard.  when you press E, it fires keyboard shortcuts for windows explorer. Read next question  for windows shortcut keys.

1 comment:

Foo111 said...

Thanks for advices.

Advice number 3 helped.

I had duplicate values in "inner query" of merge statement.