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
Conferences
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
AU$14.99 AU$60.99
Paperback
AU$75.99
Subscription
Free Trial
Renews at AU$24.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

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 : 9781849684019
Vendor :
Oracle
Category :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
AU$24.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
AU$249.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 AU$5 each
Feature tick icon Exclusive print discounts
AU$349.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 AU$5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total AU$ 257.97
Oracle Advanced PL/SQL Developer Professional Guide
AU$90.99
Oracle APEX Best Practices
AU$75.99
Oracle APEX Cookbook : Second Edition
AU$90.99
Total AU$ 257.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

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.