19 November, 2009

Strange behavior of "No Inline Validation Errors Displayed" check

. 19 November, 2009
2 Comments

I had two conditional processing checks for one pl/sql process to do. One "No Inline Validation Errors Displayed" check and one "Exist (SQL query returns at least one row)" check.

I thought it would be quite easy to merge it together into a "Exist (SQL query returns at least one row)" condition:


select *
from user_db_links
where UPPER(db_link) = UPPER(:P1_I_INSTANCE_NAME)
and (UPPER(username) not like UPPER(:P1_USERNAME)
or UPPER(host) not like UPPER(:P1_DB_NAME)
or :P1_PASSWORD is not null)
and wwv_flow.g_inline_validation_error_cnt = 0

-- and I tried this AND clause
-- and (select wwv_flow.g_inline_validation_error_cnt from DUAL) = 0

The result was less promising. It just didn't work. The pl/sql process never run with wwv_flow.g_inline_validation_error_cnt in it.

My workaround was to add a new item called :P1_ERROR. I wrote the amount of validation errors into the :P1_ERROR variable inside a pl/sql process which was running before the one I tried the conditional processing with.

-- pl/sql process 1.
...
SELECT wwv_flow.g_inline_validation_error_cnt INTO :P1_ERROR FROM DUAL;
-- or this: :P1_ERROR := wwv_flow.g_inline_validation_error_cnt;
...

-- pl/sql process 2.
select *
from user_db_links
where UPPER(db_link) = UPPER(:P1_I_INSTANCE_NAME)
and (UPPER(username) not like UPPER(:P1_USERNAME)
or UPPER(host) not like UPPER(:P1_DB_NAME)
or :P1_PASSWORD is not null)
and :P1_ERROR = 0

This works without any issues. Maybe one of you know why this happens?

Read More »»

17 November, 2009

Page refresh button

. 17 November, 2009
0 Comments

If you want to create a page refresh button inside your APEX page you need to add the following things:

1. Upload a button picture (Shared Components>Images>Create>Upload)
2. Create a new navigation bar (Shared Components>Navigation Bar Entries>Create):
- Image: "LET IT EMPTY!"
- Icon Subtext: <img src="#APP_IMAGES#page_refresh.png" title="Refresh">
- Icon Image Alt: "Refresh"
- Image Height: 40
- Width: 30
- Target type: URL
- URL Target: javascript:window.location.reload(false);

3. Watch the result:

Read More »»

16 November, 2009

Ignore sql error messages in pl/sql process

. 16 November, 2009
7 Comments

Have you experienced the case that you want to execute a process and when a specified error occurs then it should go on like nothing happened.

In my case I had several pl/sql processes and one was to delete a database link. In my special case there shouldn't be an error if no database link exists.

Here is the code snippet for it:


declare
-- error variable
v_no_link EXCEPTION;
-- Map error number returned by raise_application_error to user-defined exception.
PRAGMA EXCEPTION_INIT(v_no_link, -2024);
-- About the error: http://download.oracle.com/docs/cd/B28359_01/server.111/b28278/e1500.htm#sthref1158

begin
-- Drop existing database link
EXECUTE IMMEDIATE 'drop database link ' || UPPER(:P1_I_INSTANCE_NAME);

EXCEPTION
WHEN v_no_link THEN
null;
--WHEN OTHERS THEN
-- raise_application_error(SQLCODE, 'SQLERRM');
end;

More information: PL/SQL User's Guide and Reference - Error Handling

Read More »»

11 November, 2009

Using the APEX IRR search region

. 11 November, 2009
0 Comments

Hi all,

The APEX team integrated a nice little region template which mimics the search part of an interactive report. It is called "Report Filter - Single Row". As the name says it has only one row to implement items.

Using one graphical way for searching in your whole application makes life easier for your costumers.

There is just one thing I didn't like on it. The "Search"-icon. To erase it make a copy of the template and erase this part: <img src="#IMAGE_PREFIX#htmldb/builder/builder_find.png" />

The template definition should now look like that:


<table class="apex_finderbar" cellpadding="0" cellspacing="0" border="0" summary="" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>
<tbody>
<tr>
<td class="apex_finderbar_left_top" valign="top"><img src="#IMAGE_PREFIX#1px_trans.gif" width="10" height="8" alt="" class="spacer" alt="" /></td>
<td class="apex_finderbar_middle" rowspan="3" valign="middle"></td>
<td class="apex_finderbar_middle" rowspan="3" valign="middle" style="">#BODY#</td>
<td class="apex_finderbar_left" rowspan="3" width="10"><br /></td>
<td class="apex_finderbar_buttons" rowspan="3" valign="middle" nowrap="nowrap"><span class="apex_close">#CLOSE#</span><span>#EDIT##CHANGE##DELETE##CREATE##CREATE2##COPY##PREVIOUS##NEXT##EXPAND##HELP#</span></td>
</tr>
<tr><td class="apex_finderbar_left_middle"><br /></td></tr>
<tr>
<td class="apex_finderbar_left_bottom" valign="bottom"><img src="#IMAGE_PREFIX#1px_trans.gif" width="10" height="8" class="spacer" alt="" /></td>
</tr>
</tbody>
</table>


At the end it will look similar to that:

Read More »»

08 October, 2009

Update of my example application

. 08 October, 2009
3 Comments

Hi!

Out of some reason Oracle does not provide the applications from the APEX Developer Competition 2009.

Some winners already provided there applications:
Matt Nolan: APEX Plugin Registry Application
Martin Giffy D'Souza: APEX Rules & Guidelines

I just updated my example application as well:

APEX-AT-WORK Developer Competition 2009 Edition
Description: This application is an upgrade of the original APEX-AT-Work Example application. It includes lots of new examples, a new layout, new techniques (like screen casts) and an extended documentation. It is not a normal APEX application which includes lot's of business logic. This application shows how to use the new technologies out there. The core is based on a javascript library called ExtJS. This library creates a completely new look and feel which makes APEX even nicer to use. But also rarely used APEX WEB 2.0 features are integrated based on typical examples.

About the competition:
Oracle.com: Oracle Application Express Developer Competition 2009
David Peake's Blog: Winners of APEX Developer Competition 2009
OTN Blog: Congrats to the Oracle Apex Developer Competition 2009 Winners
Oracle.com: Rules

I must object another behavior what I can't understand. Why aren't there any jury judgments. I really would have loved to know what for example Dimitri thought about my application. I guess all other developers think the same.

Anyway I wish everybody a really exciting OOW.

Read More »»
 

Google Translator

Visitor counter

Blogger statistics