Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

   

 

  Oracle Tips by Burleson

APEX and OWA_COOKIE

The Oracle Web Agent (OWA) packages are not part of the APEX installation, but they do warrant some coverage since APEX uses them.  They are further documented in Oracle document B10802.  The name of the document is PL/SQL Packages and Types Reference.  It is a huge document and a valuable asset to which developers and programmers should have ready access.  The document can be found by using the link at the top of the chapter.

The OWA_COOKIE package deals with browser cookies.  It will write to a cookie and read from a cookie stored on the client machine.  If no date is specified, the cookie only exists during the client’s session.

Types used with the OWA_COOKIE package

type vc_arr is table of varchar2(4000)
index by binary_integer. 

type cookie is record (
name varchar2(4000),
vals vc_arr,
num_vals integer);
 

owa_cookie.send(
       name in varchar2,
       value in varchar2,
       expires in date default null,
       path in varchar2 default null,
       domain in varchar2 default null,
       secure in varchar2 default null);
 

This creates a cookie on the client browser machine.  The expires date should be specified or the cookie only exists during the life of the session.

Example:

begin
   owa_util.mime_header('text/html', FALSE);
   owa_cookie.send(
      name=>'EASY_COOKIE',
      value=>lower(:P2100_COOKIE_SOURCE),
      expires => sysdate + 365); 

   -- Set the cookie and redirect to another page
   owa_util.redirect_url(
'f?p=&APP_ID.:2101:&SESSION.' );
exception
   when others then
      null;
end;

get( name in varchar2) return cookie;

This will return a type of cookie as explained earlier.  It receives the name of the cookie to return.

Example:

declare
    v varchar2(255) := null;
    c owa_cookie.cookie;
begin
   c := owa_cookie.get('LOGIN_USERNAME_COOKIE');
   :P2100_COOKIE_TARGET := c.vals(1);
exception
   when others then
      null;
end;

owa_cookie.remove(
       name in varchar2,
       val in varchar2,
       path in varchar2 default null);

This procedure forces the cookie to expire, which essentially removes its availability to be used.  It does this by setting the expiration date to 01-JAN-1990.

Example:

begin
   owa_cookie.remove(
      name => 'EASY_COOKIE',
      value => NULL);
end;

print_cgi_env

This prints all CGI environment variable’s available to the CGI Gateway.  This procedure can be placed directly in a PL/SQL region to display the values of all the CGI variables.  Put the following code in the PL/SQL region:

print_cgi_env;


The above book excerpt is from:

Easy HTML-DB Oracle Application Express

Create Dynamic Web Pages with OAE

ISBN 0-9761573-1-4   

Michael Cunningham & Kent Crotty

http://www.rampant-books.com/book_2005_2_html_db.htm

  
 

 
 
 
 
 

 
 
 
 
 
 
Oracle training Excel
 
Oracle performance tuning software 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2014

All rights reserved by Burleson

Oracle © is the registered trademark of Oracle Corporation.