BC remote Oracle DBA - Call (800) 766-1884  
Oracle Consulting Oracle Training Development

Remote DBA

Remote DBA Plans  

Remote DBA Service

Remote DBA RAC

   
Remote DBA Oracle Home
Remote DBA Oracle Training
Remote DBA SQL Tuning Consulting
Remote DBA Oracle Tuning Consulting
Remote DBA Data Warehouse Consulting
Remote DBA Oracle Project Management
Remote DBA Oracle Security Assessment
Remote DBA Unix Consulting
Burleson Books
Burleson Articles
Burleson Web Courses
Burleson Qualifications
Oracle Links
Remote DBA Oracle Monitoring
Remote DBA Support Benefits
Remote DBA Plans & Prices
Our Automation Strategy
What We Monitor
Oracle Apps Support
Print Our Brochure
Contact Us (e-mail)
Oracle Job Opportunities
Oracle Consulting Prices





   

 

 

 

Remote DBA services

Remote DBA Support

Remote DBA RAC

Remote DBA Reasons

Remote Oracle Tuning

Remote DBA Links

Oracle DBA Support

Oracle DBA Forum

Oracle Disaster

Oracle Training

Oracle Tuning

Oracle Training

 Remote DBA SQL Server

Remote MSSQL Consulting

Oracle DBA Hosting

Oracle License Negotiation

 

 


 

 

 

 

 
 

Portability Features

Oracle Tips by Burleson Consulting

PEAR DB is written to support many database types. Not all things work quite the same way in all of them. Oracle is no exception, and if all features are to work as expected, portability options will need set. This is done either as an argument to the connect function or by the setOption() method in the DB connection class. The setOption() function has a very simple syntax:

    $db->setOption(option,value);

The available options from the online manual are listed in the table below, together with the values for the “portability” option.

OPTION

DATA TYPE

DEFAULT VALUE

DESCRIPTION

Autofree

boolean

false

Should results be freed automatically when there are no more rows?

debug

Integer

0

Debug level

persistent

boolean

false

Should the connection be persistent?

portability

Integer

db_portability_none  

Portability mode constant. These constants are bit wised, so they can be combined using | and removed using ^. See the examples below and the "Intro - Portability" for more information.

Seqname_format

string

%s_seq

the sprintf()  format string used on sequence names. This format is applied to sequence names passed to createSequence(), nextID() and dropSequence().

ssl

boolean

false

Use ssl to connect?

The available values for the ‘portability’ option are as follows:

·         DB_PORTABILITY_LOWERCASE - This option converts the names of tables and fields to lower case when using the get*(), fetch*() and tableInfo() function.

·         DB_PORTABILITY_NONE (default) - This option turns off all portability features.

·         DB_PORTABILITY_NULL_TO_EMPTY  - This option converts NULL values to empty strings in the data output by the get*() and fetch*() function. This is required because Oracle considers empty strings to be NULL, while most other DBMSs know the difference between empty and NULL.

·         DB_PORTABILITY_NUMROWS - This option enables a hack allowing the numRows() function to work in Oracle.

·         DB_PORTABILITY_RTRIM  - This option right trims the data output by the get*() and fetch*() function.

More than one option can be specified at a time by using the bitwise or the operator “|”, as shown below:

$db->setOption('portability',
         DB_PORTABILITY_NUMROWS |
         DB_PORTABILITY_NULL

If the DB_PORTABILITY_NUMROWS  bit is not set, the numRows() method of the result set does not work and the rows cannot be counted except by using the count() SQL function.

SEE CODE DEPOT FOR FULL SCRIPTS


The above book excerpt is from  "Easy Oracle PHP: Creating Dynamic Web Pages with Oracle Data". 

You can buy it direct from the publisher for 50%-off and get instant access to the code depot of Oracle tuning scripts:

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

 


Expert Remote DBA

BC is America's oldest and largest Remote DBA Oracle support provider.  Get real Remote DBA experts, call
BC Remote DBA today.

 

 

Remote DBA Service
 

Oracle Tuning Book

 

Advance SQL Tuning Book 

BC Oracle support

Oracle books by Rampant

Oracle monitoring software

 

 

 

 

 

 

BC Remote Oracle Support

Remote DBA

Remote DBA Services

Copyright © 1996 -  2013 by Burleson. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.



Hit Counter