mod_perl
7-18
Oracle HTTP Server Administrator’s Guide
This release of
DBD::Oracle
supports
SQL NCHAR
datatypes and provides driver
extension functions to specify the character form for data binding. The following
script shows an example to access
SQL NCHAR
data:
Example 7–3
Sample Script to Access SQLNCHAR Data
# declare to use the constants for character forms
use DBD::Oracle qw(:ora_forms);
# connect to the database and get the database handle
$dbh = DBI->connect( ... );
# prepare the statement and get the statement handle
$sth = $dbh->prepare( 'SELECT * FROM TABLE_N WHERE NCOL1 = :nchar1' );
# bind the parameter of a NCHAR type
$sth->bind_param( ':nchar1', $param_1 );
# set the character form to NCHAR
$sth->func( { ':nchar1' => ORA_NCHAR } , 'set_form' );
$sth->execute;
As shown in
Example 7–3
, the
set_form
function is provided as a private function
that you can invoke with the standard DBI
func()
method. It takes an anonymous
hash that specifies which placeholder should be associated with which character
form. The valid values of character form are either
ORA_IMPLICIT
or
ORA_NCHAR
.
Setting the character form to
ORA_IMPLICIT
causes the application's bound data to
be converted to the database character set, and
ORA_NCHAR
to the national character
set. The default form is
ORA_IMPLICIT
.
Another function is provided to specify the default character set form as follows:
# specify the default form to be NCHAR
$dbh->func( ORA_NCHAR, 'set_default_form' );
After this call is made, the form of all parameters is
ORA_NCHAR
, unless otherwise
specified with
set_form
calls. Note that unlike the
set_form
function, this is a
function on the database handle, so every statement from the database handle with
its default form specified has the form of your choice by default.
Summary of Contents for HTTP Server
Page 1: ...Oracle HTTP Server Administrator s Guide 10g Release 1 10 1 Part No B12255 01 December 2003 ...
Page 12: ...xii ...
Page 22: ...xxii ...
Page 38: ...About htaccess Files 2 8 Oracle HTTP Server Administrator s Guide ...
Page 52: ...Getting Information about Processes 4 8 Oracle HTTP Server Administrator s Guide ...
Page 60: ...Configuring Reverse Proxies and Load Balancers 5 8 Oracle HTTP Server Administrator s Guide ...
Page 70: ...Specifying Log Files 6 10 Oracle HTTP Server Administrator s Guide ...
Page 170: ...9 6 Oracle HTTP Server Administrator s Guide ...
Page 178: ...opmn xml A 8 Oracle HTTP Server Administrator s Guide ...
Page 212: ...Glossary 10 ...
Page 224: ...Index 12 ...