Oracle Database Application Developer's Guide - Google Sites
Recommend Documents
Oracle Database Advanced Application Developer's Guide, 11g Release 2 (11.2)
... This software and related documentation are provided under a license ...
Oracle is not responsible for the availability of, or any content provided on, third-
party Web sites. .... Configuring Your Oracle Application Express Environment .
The Programs (which include both the software and documentation) contain
proprietary information; they are provided ..... PL/SQL Web Development Tools.
The Programs (which include both the software and documentation) contain
proprietary information; they are provided ..... PL/SQL Web Development Tools.
Oracle Corporation; they are provided under a license agreement containing
restrictions on use and disclosure and are also ..... Overview of Oracle SQLJ.
Oracle Corporation; they are provided under a license agreement containing
restrictions on ...... Java: JDBC, Oracle SQLJ, JPublisher, and SQLJ Object Types.
Jan 1, 2006 ... This document is not warranted to be error-free. Except as may be .... Overview of
Oracle Application Development Framework . .... Downloading and Installing the
Oracle ADF Service Request Application............... 2-3. 2.2.2.
Oracle SQL Developer for Database Developers. Page 2. Oracle SQL Developer
for Database Developers. Introduction.
Oracle Database Administrator's Guide, 11g Release 2 (11.2) .... Oracle
Database 11g Release 2 (11.2) New Features in the Administrator's Guide............
...........
Click the button below to register a free account and download the file ... Business Intelligence repositories Access re
1. Oracle® Database. Examples Installation Guide. 11g Release 1 (11.1).
E10402-04. August 2009. This document describes how to install and configure
the ...
Oracle Database Security Guide 10g Release 2 (10.2). B14266-09 ... Oracle and
Java are registered trademarks of Oracle and/or its affiliates. Other names may ...
Oracle Database Security Guide 11g Release 2 (11.2) .... Oracle Database 11g
Release 2 (11.2.0.2) New Security Features .................................................... xxvii.
Products Available on the Oracle Database Examples Media. □ ...
Documentation Library use the example programs and scripts provided with the.
Java Developer's Guide. 11g Release 1 (11.1). B31225-05. December 2009.
This book describes how to develop, load, and run Java applications in Oracle ...
Oracle Database Performance Tuning Guide, 10g Release 2 (10.2). B14211-03
... the documentation, please report them to us in writing. This document is not ...
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to op
Dec 6, 2014 ... Oracle Database Advanced Application Developer's Guide, 11g Release 2 (11.2)
... are "commercial computer software" pursuant to the applicable ... This software
or hardware is developed for general use in a variety of ...
Buy Oracle Database Ajax amp PHP Web Application Development Oracle Press .... in english language, [download] Oracle Da
MULTI_LEXER Example: Indexing a Multi-Language Table........................................
... 3-22. BASIC_WORDLIST Example: Enabling Substring and Prefix Indexing.
oracle business intelligence 11g developers guide pdf. oracle business intelligence 11g developers guide pdf. Open. Extr
Oracle Database Application Developer's Guide - Google Sites
Oracle Database Application Developer's Guide - Fundamentals, 10g Release 1 (10.1) ... for any purpose, without the expr
Oracle® BGCOLOR="#FFFFFF"'); htp.header(1, 'Heading in the HTML File'); htp.para; htp.print('Some text in the HTML file.'); htp.bodyClose; htp.htmlClose;
You can learn the API calls corresponding to each tag, or just use some of the basic ones like HTP.PRINT to print the text and tags together: htp.print(''); htp.print(''); htp.print(''); htp.print('Title of the HTML File'); htp.print(''); htp.print(''); htp.print('Heading in the HTML File'); htp.print('
Some text in the HTML file.'); htp.print('');
13-8
Oracle >’); htp.print(’
Enter your zip code:’); htp.print(’
’); htp.formSubmit(NULL, ’Submit’); htp.formClose; END; / show errors;
Passing Hidden Parameters from an HTML Form One technique for passing information through a sequence of stored procedures, without requiring the user to specify the same choices each time, is to include hidden parameters in the form that calls a stored procedure. The first stored procedure places information, such as a user name, into the HTML form that it generates. The value of the hidden parameter is passed to the next stored procedure, as if the user had entered it through a radio button or entry field. Other techniques for passing information from one stored procedure to another include: ■
Sending a "cookie" containing the persistent information to the browser. The browser then sends this same information back to the server when accessing other Web pages from the same site. Cookies are set and retrieved through the HTTP headers that are transferred between the browser and the Web server before the HTML text of each Web page.
13-12 Oracle %> directive somewhere in the file. This directive is for compatibility with other scripting environments.
Developing Web Applications with PL/SQL
13-21
Embedding PL/SQL Code in Web Pages (PL/SQL Server Pages)
Accepting User Input User input comes encoded in the URL that retrieves the HTML page. You can generate the URL by hard-coding it in an HTML link, or by calling your page as the "action" of an HTML form. Your page receives the input as parameters to a PL/SQL stored procedure. To set up parameter passing for a PL/SQL server page, include a directive. By default, parameters are of type VARCHAR2. To use a different type, include a type="typename" attribute within the directive. To set a default value, so that the parameter becomes optional, include a default="expression" attribute in the directive. The values for this attribute are substituted directly into a PL/SQL statement, so any strings must be single-quoted, and you can use special values such as null.
Displaying HTML The PL/SQL parts of the page are enclosed within special delimiters. All other content is passed along verbatim -- including any whitespace -- to the browser. To display text or HTML tags, write it as you would a typical Web page. You do not need to call any output function. Sometimes you might want to display one line of output or another, or change the value of an attribute, based on some condition. You can include IF/THEN logic and variable substitution inside the PSP delimiters, as shown in subsequent sections.
Returning XML, Text, or Other Document Types By default, the PL/SQL gateway transmits files as HTML documents, so that the browser formats them according to the HTML tags. If you want the browser to interpret the document as XML, plain text (with no formatting), or some other document type, include a directive. (The attribute name is case-sensitive, so be sure to capitalize it as contentType.) Specify text/html, text/xml, text/plain, image/jpeg, or some other MIME type that the browser or other client program recognizes. Users may have to configure their browsers to recognize some MIME types. Typically, a PL/SQL server page is intended to be displayed in a Web browser. It could also be retrieved and interpreted by a program that can make HTTP requests, such as a Java or Perl application.
Returning Pages Containing Different Character Sets By default, the PL/SQL gateway transmits files using the character set defined by the Web gateway. To convert the %> directive. Specify Shift_JIS, Big5, UTF-8, or another encoding that the browser or other client program recognizes. You must also configure the character set setting in the %> directive.
Including the Contents of Other Files in a PSP Script You can set up an include mechanism to pull in the contents of other files, typically containing either static HTML content or more PL/SQL scripting code. Include a
Developing Web Applications with PL/SQL
13-23
Embedding PL/SQL Code in Web Pages (PL/SQL Server Pages)
directive at the point where the other file's content should appear. Because the files are processed at the point where you load the stored procedure into the width= height= alt="">
Retrieving a Result Set from a Query in a PSP Script If your background is in HTML design, here are a few examples of retrieving ] [contentType="content type string"] charset="encoding" [errorPage="file.psp"] %>
Procedure Directive Specifies the name of the stored procedure produced by the PSP file. By default, the name is the filename without the .psp extension. Syntax
Developing Web Applications with PL/SQL
13-27
Embedding PL/SQL Code in Web Pages (PL/SQL Server Pages)
Parameter Directive Specifies the name, and optionally the type and default, for each parameter expected by the PSP stored procedure. The parameters are passed using name-value pairs, typically from an HTML form. To specify a default value of a character type, use single quotes around the value, inside the double quotes required by the directive. For example:
Syntax
Include Directive Specifies the name of a file to be included at a specific point in the PSP file. The file must have an extension other than .psp. It can contain HTML, PSP script elements, or a combination of both. The name resolution and file inclusion happens when the PSP file is loaded into the %>
Declaration Block Declares a set of PL/SQL variables that are visible throughout the page, not just within the next BEGIN/END block. This element typically spans multiple lines, with individual PL/SQL variable declarations ended by semicolons. Syntax
Code Block (Scriptlet) Executes a set of PL/SQL statements when the stored procedure is run. This element typically spans multiple lines, with individual PL/SQL statements ended
13-28 Oracle %> Show Contents of Catalog (Complete Dump)
Printing the Sample Table using a Loop Next, we loop through the items in the table and explicitly print just the pieces we want. ■
■
■
We could adjust the SELECT statement to retrieve only a subset of the rows or columns. We could change the HTML or the location of the expressions to change the appearance of each item, or the order in which the columns are shown. At this early stage, we pick a very simple presentation, a set of list items, to avoid any problems from mismatched or unclosed table tags.
Show Contents of Catalog (Raw Form)
13-32 Oracle %> Show Contents of Catalog (Better Form)
Item = price =
Allowing a User Selection We have a dynamic page, but from a user point of view it may still be dull. The results are always the same unless you update the catalog table. ■
■
To liven up the page, we can make it accept a minimum price, and present only the items that are more expensive. (Your customers' buying criteria may vary.) When the page is displayed in a browser, by default the minimum price is 100 units of the appropriate currency. Later, we will see how to allow the user to pick a minimum price.
Developing Web Applications with PL/SQL
13-33
Embedding PL/SQL Code in Web Pages (PL/SQL Server Pages)
Show Items Greater Than Specified Price
This report shows the items whose price is greater than .
minprice order by price desc) loop %>
Item = price =
This technique of filtering results is fine for some applications, such as search results, where users might worry about being overwhelmed by choices. But in a retail situation, you might want to use an alternative technique so that customers can still choose to purchase other items. ■
■
■
Instead of filtering the results through a WHERE clause, we can retrieve the entire result set, then take different actions for different returned rows. We can change the HTML to highlight the output that meets their criteria. In this case, we use the background color for an HTML table row. We could also insert a special icon, increase the font size, or use some other technique to call attention to the most important rows. At this point, where we want to present a specific user experience, it becomes worth the trouble to lay out the results in an HTML table.
Show Items Greater Than Specified Price
This report shows all items, highlighting those whose price is greater than .
Product
13-34 Oracle >
Sample HTML Form to Call a PL/SQL Server Page Here is a bare-bones HTML form that allows someone to enter a price, and then calls the SHOW_CATALOG_PARTIAL stored procedure passing the entered value as the MINPRICE parameter. To avoid coding the entire URL of the stored procedure in the ACTION= attribute of the form, we can make the form a PSP file so that it goes in the same directory as the PSP file it calls. Even though this HTML file has no PL/SQL code, we can give it a .psp extension and load it as a stored procedure into the action="show_catalog_partial">
Enter the minimum price you want to pay:
Developing Web Applications with PL/SQL
13-35
Embedding PL/SQL Code in Web Pages (PL/SQL Server Pages)
Note: An HTML form is different from other forms you might
produce with tools and programming languages. It is part of an HTML file, delimited by and tags, where someone can make choices and enter %> Usage Statistics Usage Statistics
:
Developing Web Applications with PL/SQL
13-37
Embedding PL/SQL Code in Web Pages (PL/SQL Server Pages)
Coding this procedure as a regular PL/SQL stored procedure would result in convoluted lines with doubled apostrophes, such as this: htp.print('preamble = "