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

 

 


 

 

 

 

 
 

Auxiliary Methods

Oracle Tips by Burleson Consulting

During the discussion of the connect and fetch methods, several other methods were used without explaining them; with the exception of the discussion of portability methods and the numRows method, now presented here in a systematic fashion:

int DB_Result::numRows()

This method returns the number of rows returned by the query. It is enabled by setting the DB_PORTABILITY_NUMROWS option, and can only be called before the first fetch. After that, the value is not defined.

array DB_Common::tableInfo($table)

This method returns the description for a table or result set in the variable $table.  Elements of the resulting descriptor array are associative arrays with the following elements:

Element

Description

Accessed By

Table name

Table being described

table

Column name

Column described by this descriptor

name

Column type

Type of the column

type

Column length

Length of the column (in bytes)

Length

Column flags

NOT NULL or PRIMARY KEY

Flags

Table 4.2: Elements for associative arrays.

The csr2html() function uses the tableInfo()method to obtain column names in order to use them as the headers for the HTML table.

int DB_Result::numCols()

This method is also used in the csr2html() function to get the number of columns in the query.

integer DB_Common::affectedRows()

This method returns the number of rows affected by the last DELETE, UPDATE or INSERT statement. It returns 0 for queries.

boolean DB_Result::free()

This method frees the memory associated with the result set/statement handle. In the OCI8 module, the analogous operation is oci_free_statement() or oci_free_descriptor(). Calling free does not delete the variable, it just closes the cursor and relinquishes its memory. The cursor can still be reopened.

mixed DB_Common::quoteSmart($in)

This is an interesting function in that different databases have different quoting conventions. The most frequent problem arises with the single quotes, the ANSI SQL delimiter for the VARCHARand the CHARdatabase types. Different databases have different conventions. For the string, E. A. Poe’s Raven, Oracle would need this: 'E.A. Poe's Raven'. The single quote is written twice so Oracle understands that it is not a string delimiter.

Other databases perform the same task by adding a backslash character (\). At any rate, the smart quoting function is advanced enough to know which database it is being used against and to use the corresponding quoting conventions. It has a sister function in Perl DBI, simply called “quote”.

boolean DB_Common::Commit()
boolean DB_Common
::Rollback()

These two methods are self-explanatory. They implement commit and rollback database operations.

Methods belonging to the DB_Commonclass are accessed through a database connection descriptor.  Methods belonging to the DB_Result class are accessed through the result set/statement descriptors.

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