Inside Oracle APEX by Patrick Wolf

Are you looking for some Advanced Oracle APEX Training?

Are you looking for some Advanced Oracle APEX Training and do you live in Europe?

Then you should check out the European APEX Training Days of the APEX Evangelists.

John and Dimitri have announced a 3-day training in September, which covers some advanced Oracle APEX topics like AJAX, SOA Integration, Securing your Application, Customizing Themes and Templates, ...

That's your chance in Europe to benefit from the knowledge of John and Dimitri!

John has been "Oracle APEX developer of the year 2006" (by Oracle Magazine) and is the author of the book "Pro Oracle Application Express".

Dimitri is a well known contributor on the OTN Oracle APEX forum and speaker at Collab'07 and ODTUG Kaleidoscope.

Labels: , ,


« ... Read full posting ... »

New Oracle APEX podcast

Lewis Cunningham from ITToolbox has done an Oracle APEX podcast with David Peak (Oracle APEX Product Manager) and Peter Martin (APEX user).

Check it out at "The Buzz about Oracle APEX"

Update: Just saw that Dimitri has published a summary of the podcast.

Labels: , ,


« ... Read full posting ... »

The mystery of Outer Joins

From my long time experience with Oracle, I noticed that a lot of people have problems with Outer Joins. Especially if the Outer Join also contains an additional restriction on the outer join table.

A few days ago I read a good article about that on Jeff's blog - be warned, it's a MS SQL Server blog ;-) - the article is called Criteria on Outer Tables and has good examples explaining the problem.

BTW, if you are new to the "new" ANSI style joins, check out Eddie Awad's article series about the different ANSI style joins.

Labels: ,


« ... Read full posting ... »

Oracle APEX Builder Plugin available for Internet Explorer

The Oracle APEX Builder Plugin is now also available for Internet Explorer!

For a long time I was looking for a Greasemonkey like add-on for Internet Explorer. I found several of them, like Greasemonkey for IE, Trixie or Turnabout. But the drawback of all of them is that they are not maintained anymore. In most cases development stopped already more than a year ago and the homepages do not mention if they work with Internet Explorer 7 or not.

On Saturday I finally found IE7Pro, which supports IE 6/7. And the good news is that it's actively developed. It has some other features too, but I was just interested in the scripting feature.

After adapting my Greasemonkey APEX Builder Plugin script yesterday, I'm proud to announce Oracle APEX Builder Plugin release 1.6 with support for Internet Explorer and Firefox!

Internet Explorer users can now gain the same productivity enhancements in there Oracle APEX Builder as Firefox users. Like
Download the new version and follow the HowTo Install file for the necessary installation and configuration steps.

Labels: , , , ,


« ... Read full posting ... »

Oracle APEX blog community is growing

The Oracle APEX blog community is growing and growing. In the last few weeks 7 new APEX related blogs have been started.

Check out the blogs of
Welcome on board!

Labels: , ,


« ... Read full posting ... »

Oracle APEX related articles you should read

Lately a few Oracle APEX related articles have been published which you should read.

Labels: , , ,


« ... Read full posting ... »

New version of Migration Workbench available

Just read on Donal Daly's blog, that a new version of the Migration Workbench is available.

If you haven't heard of the Migration Workbench yet, that's a tool you can use to migrate your MS Access/SQL Server/MySQL database to Oracle.

Labels: , , , ,


« ... Read full posting ... »

What is your favorite PL/SQL development environment?

Mine is PL/SQL Developer from allroundautomations.

Why?

Because it's a PL/SQL development tool focused on PL/SQL development. Most of the other tools like TOAD or SQL Developer which I also used in the past, have great DBA/query functionality, but suck from a "state of the art" programming point of view.

Sure they all have a PL/SQL editor with auto replace and template support. In the meanwhile SQL Developer is now also able to do file based PL/SQL development. In one of the first versions you could just edit the packages stored in the database repository. Can you imagine doing professional development where your code is just stored in the database?!?! Me not! That was a killer criteria not to use it at that time - independent if it was for free or not.

So what makes PL/SQL developer different compared to TOAD and SQL Developer?

It's the code complete/code insight/auto complete or however the IDEs call it and which you are used to from modern Java/.Net/... IDEs. Now you will say: "Hey, TOAD and SQL Developer have that too!". Yes they have, but just a basic one which only offers auto complete for tables/views.

The auto complete I'm talking about knows about the PL/SQL code you wrote. If works for local variables, packages, procedures of the packages, parameters of this procedures, ... If you are getting used to to press Alt+space to complete what you are typing, it can really speed up your development!

I'm not talking about the other features like refactoring support, variable highlighting and so on what the tool also offers. Check it out by yourself.

If you are used to TOAD, changing to this new IDE can be a little bit irritating at the beginning, because the way windows are handled is different and you have to get used to the SQL Window which requires a semi-color for SQL statements.

But it's worth trying out - from a PL/SQL developer point of view - a DBA should stay with his TOAD/SQL Developer.

BTW, I'm not paid for this article. I'm just a satisfied user of that tool and I see to often unproductive PL/SQL development with the wrong tools.

Update: Another useful feature is the integrated compiler which shows you warnings for unused variables/parameters or if the naming doesn't comply to your styleguide.

Labels: ,


« ... Read full posting ... »

Pimp your Oracle APEX Builder

The disadvantage of the new "Web-World" is that most web pages/applications are not really usable with the keyboard. There are no keyboard shortcuts to trigger different actions like saving the changes, ... You always have to use the mouse for that, from a usability point of view that's not good :-(

The Oracle APEX development environment is also written in APEX and runs therefor in the browser. By default there are no keyboard shortcuts to "Apply Changes", "Run the page", ... But here comes the rescue of you productivity and usability! :-)

I thought it's time for a new version of the APEX Builder Plugin, especially because it now has it's own Sourceforge project.

So what's new in this version?

First of all, you have the possibility to define keyboard shortcuts for buttons, links, tabs or items. I have already creates some general keyboard shortcuts, but it's up to you to change them.
  • F8 to run the page
  • F10 for "Apply Changes". Note: You have to change the value for other languages!
  • Ctrl+cursor-left to go to the previous page/page item/column
  • Ctrl+cursor-right to go to the next page/page item/column
  • On the report definition pages use Alt+1, Alt+2, Alt+3 to activate the different tabs
See the HowTo Install document for details how to define your own shortcuts.

Another enhancement is also related to the usage of the keyboard. On tabular forms, like the "Bulk update page items" page, you are now able to use cursor up/down to scroll through the rows.

The third enhancement allows you to display a background image or change the background color of your APEX Builder if you are running on a production environment. See the example screenshot I have done based on the provided example in the distribution.

You don't want to have such a background? Just remove it from the config\apex_builder_plugin.js configuration file.

Never used the Oracle APEX Builder Plugin?

Have a look at all the other features.

Download the Plugin and follow the installation and configuration steps in the HowTo Install document!

Change Log of the new version
  • CR# 1699530: Plugin should also support checkbox fields
  • CR# 1717258: Change Background color/Image of APEX Builder IDE
  • CR# 1717896: Allow keyboard shortcuts for buttons and links
  • CR# 1717798: Add cursor up/down support for tabular forms


Labels: ,


« ... Read full posting ... »

Printer friendlier blog layout

I have added some new CSS styles to my blog layout, which removes all the graphics and the sidebar, in case if you print an article. That way the layout should be much printer friendlier.

Happy printing!

Labels:


« ... Read full posting ... »

Top Oracle Blogs

Eddie Awad posted a list of the Top Oracle Blogs Ranked by Technorati Authority today.

I'm on 17th place! :-)

I'm currently equal with IT-eye. Can someone add a link to my blog so that I pass them ;-)

« ... Read full posting ... »

Opening URL in a new window

You want to create a button or a navigation list entry where you want to open an URL in a new browser window?

With plain HTML you would normally just write
<a href="http://url/" target="_blank">

but how to specify the target="_blank" in Oracle APEX, where you just have the property "URL Target" which just allows you to enter the URL?

Sure you could use some Javascript code to open a new window or something similar. Sounds a little bit complicated, or? There must be an easier way!

There is!

You can use the same technique as for SQL injection. Just write
http://url/" target="_blank

into the "URL Target" property. APEX will add the closing quote after _blank for you, because it thinks the URL ends there. That way APEX generates a valid a href with a target for you.

For buttons where APEX generates a javascript:redirect('yoururl') you have to use.
javascript:window.document.location.href='http://yoururl/'" target="_blank


Labels: , ,


« ... Read full posting ... »

Creating a Gantt-chart in SQL

A few days ago Lucas Jellema from AMIS posted a real nice SQL statement to generate a character based Gantt-chart.

I think it's a good demonstration of the possibilities and the power of SQL. Have a look!

Labels: , , ,


« ... Read full posting ... »

Nice APEX success story

Just came across Herod's blog, which features a nice APEX migration success story.

Labels: , ,


« ... Read full posting ... »

New blog layout

As you may have noticed, I have updated the layout of my blog. I thought it's time that my blog gets it's own layout and I wanted to get rid of the default layout of blogspot.

Another advantage of the new layout is that it adapts to the width of the browser and by that it should use more space for the content, especially on big screens. That's for example something I don't like on a lot of blogs, that they are optimized for 800x600. With the sidebar there is just to less space left for the content.

I would appreciate feedback if the layout looks good on the different browsers and operating systems, because if you have already played a little bit with CSS you will have noticed that CSS/browser layouting can be a nightmare. If it looks nice on Firefox, you can be sure that IE 7 displays it differently and if it also works in IE 7 it will not display correctly on IE 6...

Have fun with the new look and feel!

PS: Thanks to Dimitri, who helped me with an CSS issue.

« ... Read full posting ... »

Sending a SMS to a mobile phone

Today I read an article on Grant Rolands blog about sending a SMS from Oracle Forms through a Web-Service.

I thought it would be nice to have the same in APEX and PL/SQL, too. For example if you have a system failure or get a new order in your shop...

Grant is using a Web-Service provided by Esendex, but I'm sure there are others service providers available too. First I thought using the offered Web-Service and create a PL/SQL wrapper for it our use the Web-Service feature of APEX.

But I decided to go with the simple POST version which is also offered by them. Because why invoke all the Java stuff when there is also a simple version available. The APEX web-service couldn't be used, because then you would not be able to call it from PL/SQL.

The code is quite straight forward. Get a free account, replace the constant values in the example procedure and you are ready to go!

Note: If you have a proxy then you have to uncomment the proxy line. There is also a secure version available which uses HTTPS, but that requires a wallet, ... and I just wanted to demonstrate that it works. The error handling of the procedure could also be improved, but hey, it's just a demonstration. :-)

Have fun waking up your operators/DBAs in the night! :-)

To send a SMS just call the procedure with
BEGIN
sendSMS('+436991812345','this is a test');
END;
Here comes the example procedure:
CREATE OR REPLACE PROCEDURE sendSMS
( pRecipient IN VARCHAR2
, pBody IN VARCHAR2
)
IS
ESENDEX_USERNAME CONSTANT VARCHAR2(40) := 'your_username';
ESENDEX_PASSWORD CONSTANT VARCHAR2(40) := 'your_password';
ESENDEX_ACCOUNT CONSTANT VARCHAR2(40) := 'your_account';
--
vRequest Utl_Http.req;
vPostText VARCHAR2(500);
vResponse Utl_Http.resp;
vResponseText VARCHAR2(2000);
vErrorText VARCHAR2(200);
BEGIN
----------------------------------------------------------------------------
-- Build text for the post action.
-- For a field description, see
-- http://www.esendex.com/secure/messenger/formpost/SendSMS.aspx
----------------------------------------------------------------------------
vPostText :=
'EsendexPlainText=YES' ||CHR(38)||
'EsendexUsername=' ||Utl_Url.escape(ESENDEX_USERNAME, TRUE)||CHR(38)||
'EsendexPassword=' ||Utl_Url.escape(ESENDEX_PASSWORD, TRUE)||CHR(38)||
'EsendexAccount=' ||Utl_Url.escape(ESENDEX_ACCOUNT, TRUE)||CHR(38)||
'EsendexRecipient='||Utl_Url.escape(pRecipient, TRUE)||CHR(38)||
'EsendexBody=' ||Utl_Url.escape(pBody, TRUE);
----------------------------------------------------------------------------
-- if you need to set a proxy, uncomment next line.
----------------------------------------------------------------------------
/* Utl_Http.set_proxy('proxy.it.my-company.com', 'my-company.com'); */
----------------------------------------------------------------------------
-- Send SMS through the Esendex SMS service.
----------------------------------------------------------------------------
vRequest := Utl_Http.begin_request
( url => 'http://www.esendex.com/secure/messenger/formpost/SendSMS.aspx'
, method => 'POST'
);
Utl_Http.set_header
( r => vRequest
, name => 'Content-Type'
, value => 'application/x-www-form-urlencoded'
);
Utl_Http.set_header
( r => vRequest
, name => 'Content-Length'
, value => LENGTH(vPostText)
);
Utl_Http.write_text
( r => vRequest
, data => vPostText
);
vResponse := Utl_Http.get_response(vRequest);
IF vResponse.status_code = '200'
THEN
Utl_Http.read_text(vResponse, vResponseText);
--
IF vResponseText NOT LIKE 'Result=OK%'
THEN
vErrorText := vResponseText;
END IF;
ELSE
vErrorText := 'HTTP status: '||vResponse.status_code||'-'||vResponse.reason_phrase;
END IF;
--
Utl_Http.end_response(vResponse);
--
IF vErrorText IS NOT NULL
THEN
RAISE_APPLICATION_ERROR(-20001, 'Sending SMS failed with '||vErrorText);
END IF;
END sendSMS;


Labels: , , , ,


« ... Read full posting ... »

Lock conflicts with Automatic Row Processing (DML)

Oracle APEX 3.0 contains a nice new feature you should be aware of. There is a new substitution variable APEX_DML_LOCK_WAIT_TIME which you can use to define how the behavior of the "Automatic Row Processing (DML)" and ApplyMRU/D processes should be in case if the processed row is locked.

With the current setting APEX will wait forever until the row gets unlocked. The bad think about that is that users don't really wait long, they will press the stop button of the browser and submit the changes again and again. And everytime a new database connection from the connection pool is consumed and never released. Probably that would be an interesting denial of service attack vector, but that's a different story.

When can such a locking situation occur?

For example if you have a database where you also have an Oracle Forms application to access the same data, or any other client/server application. Because it's quite common for such applications, that they have a pessimistic locking strategy which means that they lock the row as soon as the users starts to change something. APEX and most web applications use an optimistic locking strategy.

Locks can also exist for a longer time if you have long running batch jobs or something similar which are not immediately committing there changes.

What setting should I use?

I would suggest to set the new substitution value to 0 in every application you create. Independent if you have the above scenario. A setting of 0 will immediately raise an error if the row is locked.

Other options can be found in the online documentation in the chapter About DML Lockings. More background information can be found in the related OTN thread.

Labels: , , ,


« ... Read full posting ... »