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 Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
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
Estimated delivery fee Deliver to Latvia

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

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 Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Latvia

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

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 the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela