Posts

Mac OSX, Bootcamp and a Missing Hash Key

I bought a Mac Book Pro about 8 months ago as my main business Laptop. Coupled with a copy of Parallels, I built my Oracle Server (Database and Apps Server) on a Windows VM environment which left Mac OSX free for Development using SQL Developer, Dreamweaver etc A couple of weeks back I decided to upgrade to OSX Leopard and install windows natively using Bootcamp to utilise both core's on the CPU and all 3 Gig of memory. All well and good until i tried to use the Hask key (Alt + 3 in OSX) when working on some APEX templates. After much research on the web, it appears that most OSX key mappings are installed when using bootcamp but in order to print the hash (#) symbol, you must use Ctrl + Alt + 3 Simple when you know how

Multiple Verison of I.E on one machine

After the lastest round of updates were installed from Microsoft, I foolishly forgot to uncheck the "Upgrade to I.E 7" box and hence after a reboot, a fresh new version of Internet Explorer was waiting for me. On face value this appeared ok until I tried to access Mercury Test Director. According to the error message, only I.E 6 was supported. A quick search on google and I happened upon this website: http://tredosoft.com/Multiple_IE and downloaded the installer which contained multiple version of I.E from 3.0 to 6.0 that run in standalone. Not only has this fixed my problem of accessing applicaitons, it also allows me to test my applications against earlier versions of I.E. Very useful indeed

Custom Authentication / Authorisation Schemes (Part 1)

I often see posts on the APEX forum asking how to implement custom Authentication / Authorisation schemes within their applications. The following is something I have used in several apps over the last couple of years and provides a great base for securing your application. The code base is largley based on the rather excellent article " Storing Passwords in the Database " found here with a few tweaks and changes. Firstly, just to clarify, Authentication Schemes control access to the application and Authorisation Schemes control access to page items / regions and even pages themselves. Implementing your own Authentication I tend to set up an APP_USERS table that stores Username and encrypted passwords that I Authenticate against when page 101 is submitted. All this will be explained in detail as we go. Create the APP_USERS table CREATE TABLE APP_USERS ( USERNAME VARCHAR2(10), PASSWORD VARCHAR2 (255) ); Create the Application Security Package CREATE OR REPLACE PACKAGE app_sec

Centrally Managed TNSNAMES and SQLNET

For a while now I have had 3 Oracle Homes on my Laptop (Database, 10gIDS and 10gBI Tools) and several more on my server at home. It annoyed me that every visit to a new client site requried configuring multiple tnsname entries in all the Client Side apps. A collegue at work demonstrated how to centrally manage your tnsnames so that all client apps use the same file. Simply save your tnsnames and sqlnet files into a directory on your server (d:\My Documents\TNSNAMES) Change the tnsnames and sqlnet entries in all the clients to: ifile = d:\My Documents\TNSNAMES\tnsnames.ora ifile= D:\My Documents\TNSNAMES\sqlnet.ora And there you go, any changes to the centrally manages tnsnames / sqlnet files will be visible by all client apps pointed to use them.

Render Excel Spreadsheet in IE

A while back we had a requirement to generate a lot of heavily formatted Excel type reports out of our application. The users also wanted this integrated seamlessly into the application so that when the report was run, it displayed in the same Internet Explorer window. After a bit of research and plenty of goggling, we came up with this solution (this demo uses a copy of the emp table from the Scott schema): Appologies in advance if the SQL / PL/SQL or HTML format gets a bit messed up but it should compile ok. N.b. I must first point out that this only works in Office 95/2003 and IE. Firefox will generate the report but opens Excel to do so. Please take any of this code and extend it to support Office 2007 and Firefox. It is only meant as a guide / proof of concept. Credit for this one goes to my colleague David Blake as he did the lifting on this one. Create this package (I create this in its own schema and have a public execute but creating it in the schema you are working is

Stop Page Submission When Enter is Pressed

If you have an HTML page containing only 1 Textbox, standard HTML / browser behavior is to allow the page to be submitted when entered is pressed. Normally I don't have an issue with this but in APEX, no request value is picked up when the page is submitted this way. Consequently, you usually get an error implying there is no page to branch to as the page was submitted without a request value. The solution to this problem is very simple. Create a dummy textbox on the page and in the: HTML Form Element Attributes attribute, enter the following: style="display:none;" Now because the browser thinks 2 textboxes exist, page submission by pressing enter will not occur. Simple solution to a small but annoying problem

Custom Error Handling in APEX

If like me you have written several PL/SQL procedures within your APEX app, you will have had to deal with the issue of error handling. As a general rule, I try to hide all Oracle Error Messages from the user and replace these with something more meaningful for example: If a user breaks a unique key by trying to insert the same value twice, the following error message is not uncommon: ORA-00001 Unique constraint violated There is little or no merit rendering this message to a user as those outside the Oracle community, may not be able to deduce what went wrong. We can capture this error and translate it to a user friendly message explaining what went wrong for example: The record you tried to create already exists. Please try again In order to achieve this in APEX, the process is relativly simple. Set up your Custom Error Page 1. Create a new page with the following attributes: Page type: Blank Page Page Number: your choice (for this example I used page 500) Page Alias: ERRPAGE Name: