Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Oracle APEX Best Practices
Oracle APEX Best Practices

Oracle APEX Best Practices: Make the most of Oracle Apex with this guide to best practices. It will help you look at the bigger picture when building applications and take more elements into account such as security and performance.

eBook
€8.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Oracle APEX Best Practices

Chapter 2. Leveraging the Database

Even with basic SQL and PL/SQL skills, it is possible to create applications with APEX that are both fast and secure. You probably know that the APEX engine is built by using SQL and PL/SQL. This means that all the features available in SQL and PL/SQL are available to you when you create an application with APEX. When you leverage the functionality that the database has to offer, you will get functionality developed and supported by Oracle. By utilizing the built-in functionality, you will not only save time, but also money to be spent on development. The key thing is to leverage what is available to you instead of trying to reinvent the wheel.

In this chapter we will cover the following subjects:

  • Instrumentation

  • Efficient lookup tables

  • Analytic and aggregate functions

  • Offloading long running programs

  • Pipelined table functions

  • Resizing images

  • Oracle text

Instrumentation


Have you ever found yourself in a situation where a user contacts you and reports a problem, which you can't reproduce on your own environment? What would really be helpful is knowing how your code was being used, with which values your stored procedures were called, and which code path the user took to get to the situation they found themselves in before they contacted you.

There is a way to know all this information, and the way to get it is by properly instrumenting your code. Instrumenting your developed code means putting in debug statements throughout. In these debug statements, there should be the information you need to track the execution of the developed code. Also, it should be complete with timestamps and other meaningful information.

Tyler Muth has written an excellent utility to help you with instrumenting your code. This package is called Logger and can be used to instrument your code—not only your APEX code, but also your database stored procedures. One of...

Efficient lookup tables


Properly designing the data model plays a crucial part in the success of your application. An application can have a really good-looking interface, but when the performance is very poor the users still won't be happy with the application. To ensure your user has an overall positive experience, the application needs to be visually attractive and responsive to the actions that the user carries out.

Note

Designing the application begins with designing a logical and physical data model. There are many types of database objects, that can be used in an Oracle database, such as heap tables, index organized tables, clusters, b-tree indexes, or bitmap indexes. Each of these objects has its own usage. Before implementing the physical data model, you should know each of these object types and when to use them properly. You will not be able to know which object type to choose, if you don't know how the application is going to be used. Knowing how the application is going to be...

Analytic functions


Analytic functions were introduced quite a long time ago—Oracle 8.1.6 Enterprise Edition in around 1999—yet they are still quite unknown to a lot of developers.

With analytic functions you can retrieve data from more than one row at the same time without the need for a self join. You can create a ranking based on a value within a group of values. They are not easy to use, but once mastered, analytic functions can make your life a lot easier. With analytic functions, you can create the overviews that the customer may want within a few lines of code.

Syntax overview

The processing order of a query with analytic functions happens in three stages. First of all the Joins, WHERE conditions, GROUP BY, and HAVING clauses are applied. Next, the analytic functions are applied to the resulting result set. Finally, the ORDER BY clause is processed. This order of processing is important to know, because after getting comfortable with analytic functions, it is quite easy to get carried...

Aggregate functions


Creating multilevel totals with aggregate functions might not be the first thing you think about. This has been a capability of the aggregate functionality for quite some time.

The purpose of the GROUP BY clause is to group rows together, based on the columns specified. But with aggregates, you don't always need to specify columns. When you want a grand total, you can omit the GROUP BY clause altogether:

SQL> select sum (sal)
  2    from emp
  3  /

  SUM(SAL)
----------
     29025

Omitting the GROUP BY clause leads to a grand total, but you can also use an empty set in the GROUP BY clause:

SQL> select sum (sal)
  2    from emp
  3   group by ()
  4  /

  SUM(SAL)
----------
     29025

On line 3 the empty set is used, denoted by the opening and closing braces ().

There is a lot more about aggregates, such as GROUPING SETS, ROLLUP, and CUBE.

Grouping sets

In the preceding example, we created a grand total by using an empty set in the GROUP BY clause. The GROUPING SETS clause...

Searching the contents of documents


Because we are creating a document management system, there are going to be documents stored inside the database, obviously. Searching through these documents is a must-have feature. Oracle supports this kind of functionality in the form of Oracle Text functionality.

In order to work with the Oracle Text feature, we need a special type of index—a context index—on our documents tables, more specifically on the column that stores the document:

SQL> create index doc_index on documents (document)
  2  indextype is ctxsys.context
  3  parameters ('SYNC (ON COMMIT) TRANSACTIONAL')
  4  /

Index created.

The index type that is needed for Oracle Text is CTXSYS.CONTEXT (line 2). On line 3, we specify that we want this index to be refreshed when a commit is issued.

Note

There are many more options that can be used with Oracle Text, such as searching for alternative spelling, searching for words in a certain context, or searching independent diacritic characters. More...

Summary


In this chapter, we looked at some of the lesser-known features of SQL and PL/SQL, but there are many, many more. Thorough knowledge of SQL and PL/SQL is essential to an APEX developer.

We started by examining a method to instrument your database code. This enables you to keep track of the code path and the arguments that are passed down.

Next different options were investigated to have efficient lookup tables for your application. Creating a proper physical data model by using the right types of database object where appropriate will also contribute to a successful application and a better user experience.

Analytic and aggregate functions leverage the functionality that SQL has to offer out of the box. Using these functions, you can create statements that are both elegant and perform well.

When you have programs that take a long time, and you don't want to have the user wait for the response, you can offload these programs to the background. We saw an example on using DBMS_JOB to do...

Left arrow icon Right arrow icon

Key benefits

  • "Oracle APEX Best Practices" will get you started with Oracle APEX for developing real-world applications that perform and maximize the full potential of Oracle APEX
  • You will also learn to take advantage of advanced SQL and PL/SQL along the way
  • Combines the knowledge of Oracle Apex Experts -- Alex Nuijten, Iloon Ellen-Wollf, and Learco Brizzi
  • Setting up your environment and getting ready for developing applications

Description

Have you ever wanted to create real-world database applications? In this book you're not only getting APEX best practices, but will also take into account the total environment of an APEX application and benefit from it."Oracle APEX Best Practices" will guide you through the development of real-world applications. It will give you a broader view of APEX. The various aspects include setting up APEX environment, testing and debugging, security, and getting the best out of SQL and PL/SQL.In six distinct chapters you will learn about different features of Oracle APEX as well as SQL and PL/SQL.Do you maximize the capabilities of Oracle APEX? Do you use all the power that SQL and PL/SQL have to offer? Do you want to learn how to build a secure, fully functional application? Then this is the book you'll need. "Oracle APEX: Best Practices" is where practical development begins!

Who is this book for?

This book is filled with best practices on how to make the most of Oracle APEX. Developers beginning with application development as well as those who are experienced will benefit from this book. You will need to have basic knowledge of SQL and PL/SQL to follow the examples in this book.

What you will learn

  • Lesser known features of SQL and PL/SQL
  • Incorporate printing capabilities
  • Create secure applications
  • Troubleshooting and Debugging
  • Setting up your environment
  • Best practices for building real life applications

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 05, 2012
Length: 298 pages
Edition : 1st
Language : English
ISBN-13 : 9781849684002
Vendor :
Oracle
Category :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Nov 05, 2012
Length: 298 pages
Edition : 1st
Language : English
ISBN-13 : 9781849684002
Vendor :
Oracle
Category :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 139.97
Oracle Advanced PL/SQL Developer Professional Guide
€48.99
Oracle APEX Best Practices
€41.99
Oracle APEX Cookbook : Second Edition
€48.99
Total 139.97 Stars icon
Banner background image

Table of Contents

6 Chapters
Prepare and Build Chevron down icon Chevron up icon
Leveraging the Database Chevron down icon Chevron up icon
Printing Chevron down icon Chevron up icon
Security Chevron down icon Chevron up icon
Debugging and Troubleshooting Chevron down icon Chevron up icon
Deploy and Maintain Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3
(6 Ratings)
5 star 66.7%
4 star 16.7%
3 star 0%
2 star 16.7%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Christopher E. Lewis Apr 25, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Well written with excellent directions and tips.I highly recommend for anyone using Oracle's ApEx.Christopher LewisDirector of Computer ProgrammingSUNY Fredonia
Amazon Verified review Amazon
Surachart Opun Jan 30, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is a good book that has been written about APEX. It's all useful for readers who want to learn from real-world apex and experience from writer.I really like Chapter 2 from this book. It gave me a lot of idea about APEX and SQL. If readers want to find a book about APEX. This is one book they shouldn't miss. However, Readers should understand what they will see in a book.Chapter 1: Prepare and BuildChapter 2: Leveraging the DatabaseChapter 3: PrintingChapter 4: SecurityChapter 5: Debugging and TroubleshootingChapter 6: Deploy and MaintainPrice!!! It's should cheaper. If it's during promotion. You don't should miss to get it.
Amazon Verified review Amazon
Scott Wesley Dec 27, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I've written a more detailed review on my blog, linked from my Amazon profile page.Buy this book. Perfect information if you are intermediate to advanced, but what should be a required read for all APEX technologists. Kudos to the authors & publisher.It covers a lot of ground, even the first chapter mentioned many aspects for consideration, ensuring the reader is aware of what to consider.Chapter 2 is the most brilliant, and people should read this a university/college/school if they really want to know how you can use Oracle well.The remaining chapters also have great content and effectively cover a large amount of ground, but you're ROI is in the first two alone.Scott
Amazon Verified review Amazon
Michel van Zoest Jan 29, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book was written by 3 well known names in the Dutch APEX community. With knowledge from years of experience in APEX development and from within the Oracle company itself, this book already promises great things from the cover on.I think the authors have done very well in explaining how you can create better APEX applications. They give ample examples of why a certain approach is better than others and explain how to enhance the way you create applications. This goes from how to set up a good debugging environment to enhancing the security of your applications.The information in this book is a must-read for any beginning APEX developer, but helps experienced developers as well. I know that I learned some new things to make my life easier :-)
Amazon Verified review Amazon
Piotr Jasinski Jan 29, 2013
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I think this position is a must for APEX developer. It sums almost all you need to know about building proper APEX applications. Very good for beginners (with at least 1-2 applications created) and intermediate users. Advanced users should now this kind of things but remanding them from time to time is a plus ;)One thing is bad - the price of this book is to high (right now $50). But I'm from "poor" country and maybe it's just me :/
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.