Add ORA_STRING and ORA_CHARZ to :ora_types so all four valid values for
ora_ph_type are available as symbolic constants.  This seemed reasonable
since the ora_type values and the ora_ph_type values are both used to set
ftype.

Add :ora_ses_modes so ora_session_mode can be set with a symbolic constant.

Document ora_ph_type.

Document ora_type.  It's shown all over the place, even in DBI.pm, but
there was no section describing it.

Add a pointer to CPAN Search in "SEE ALSO".  I frequently want to point
people to Oracle.ex/, but if they installed using ActiveState PPM, they
don't have a copy of that directory where they can look at it.

Remove some Todos.  I think there are a couple more that can go, but I'm
not sure enough to do it.

I considered documenting prepare() attributes ora_parse_lang, ora_auto_lob,
and ora_check_sql, but I wasn't sure if you wanted them exposed yet.

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.
--- Oracle.pm-1 2002-09-09 18:03:48.000000000 -0700
+++ Oracle.pm   2002-09-12 18:06:16.000000000 -0700
@@ -23,14 +23,14 @@ my $ORACLE_ENV  = ($^O eq 'VMS') ? 'ORA_
     @ISA = qw(DynaLoader Exporter);
     %EXPORT_TAGS = (
        ora_types => [ qw(
-           ORA_VARCHAR2 ORA_NUMBER ORA_LONG ORA_ROWID ORA_DATE
-           ORA_RAW ORA_LONGRAW ORA_CHAR ORA_MLSLABEL ORA_NTY
+           ORA_VARCHAR2 ORA_STRING ORA_NUMBER ORA_LONG ORA_ROWID ORA_DATE
+           ORA_RAW ORA_LONGRAW ORA_CHAR ORA_CHARZ ORA_MLSLABEL ORA_NTY
            ORA_CLOB ORA_BLOB ORA_RSET
        ) ],
+        ora_ses_modes => [ qw( ORA_SYSDBA ORA_SYSOPER ) ],
     );
     @EXPORT_OK = ('ORA_OCI');
-    Exporter::export_ok_tags('ora_types');
-
+    Exporter::export_ok_tags(qw(ora_types ora_ses_modes));
 
     my $Revision = substr(q$Revision: 1.92 $, 10);
 
@@ -824,10 +824,13 @@ Thanks to Mark Dedlow for this informati
 
 The ora_session_mode attribute can be used to connect with SYSDBA
 authorization and SYSOPER authorization.
+The ORA_SYSDBA and ORA_SYSOPER constants can be imported using
+
+  use DBD::Oracle qw(:ora_ses_modes);
+
+Example:
 
-  $mode = 2;   # SYSDBA
-  $mode = 4;   # SYSOPER
-  DBI->connect($dsn, $user, $passwd, { ora_session_mode => $mode });
+  $dbh = DBI->connect($dsn, $usr, $pwd, { ora_session_mode => ORA_SYSDBA });
 
 =item ora_oratab_orahome
 
@@ -848,6 +851,85 @@ monitoring and performance tuning purpos
 
 =back
 
+=head2 Database Handle Attributes
+
+=over 4
+
+=item C<ora_ph_type>
+
+The default placeholder data type for the database session.
+The C<TYPE> or L</ora_type> attributes to L<DBI/bind_param> and
+L<DBI/bind_param_inout> override the data type for individual placeholders.
+The most frequent reason for using this attribute is to permit trailing spaces
+in values passed by placeholders.
+
+Constants for the values allowed for this attribute can be imported using
+
+  use DBD::Oracle qw(:ora_types);
+
+Only the following values are permitted for this attribute.
+
+=over 4
+
+=item ORA_VARCHAR2
+
+Strip trailing spaces and allow embedded \0 bytes.
+This is the normal default placeholder type.
+
+=item ORA_STRING
+
+Don't strip trailing spaces and end the string at the first \0.
+
+=item ORA_CHAR
+
+Don't strip trailing spaces and allow embedded \0.
+Force 'blank-padded comparison semantics'.
+
+=item ORA_CHARZ
+
+Don't strip trailing spaces and end the string at the first \0 (maybe).
+Force 'blank-padded comparison semantics'.
+
+=back
+
+=back
+
+=head2 Placeholder Binding Attributes
+
+These attributes may be used in the C<\%attr> parameter of the
+L<DBI/bind_param> or L<DBI/bind_param_inout> statement handle methods.
+
+=over 4
+
+=item ora_type
+
+Specify the placeholder's data type using an Oracle data type.
+A fatal error is raised if C<ora_type> and the DBI C<TYPE> attribute
+are used for the same placeholder.
+Some of these types are not supported by the current version of
+DBD::Oracle and will cause a fatal error if used.
+Constants for the Oracle datatypes may be imported using
+
+  use DBD::Oracle qw(:ora_types);
+
+Meaningful values when DBD::Oracle was built using OCI 7 and later:
+
+  ORA_VARCHAR2, ORA_STRING, ORA_NUMBER, ORA_LONG,
+  ORA_ROWID, ORA_DATE, ORA_RAW, ORA_LONGRAW,
+  ORA_CHAR, ORA_CHARZ, ORA_MLSLABEL, ORA_RSET
+
+Additional values when DBD::Oracle was built using OCI 8 and later:
+
+  ORA_CLOB, ORA_BLOB, ORA_NTY
+
+See L</Binding Cursors> for the correct way to use ORA_RSET.
+
+See L</Handling LOBs> for the correct way to use ORA_CLOB and ORA_BLOB.
+
+See also L<DBI/Placeholders and Bind Values> for more information.
+
+=back
+
 =head1 Metadata
 
 =head2 C<table_info()>
@@ -1396,6 +1478,9 @@ Also PL/Vision from RevealNet and Steven
 
 L<DBI>
 
+http://search.cpan.org/author/TIMB/DBD-Oracle/MANIFEST for all files in
+the DBD::Oracle source distribution including the examples in Oracle.ex/.
+
 =head1 AUTHOR
 
 DBD::Oracle by Tim Bunce. DBI by Tim Bunce.
--- Oracle.xs-1 2001-08-29 12:39:24.000000000 -0700
+++ Oracle.xs   2002-09-12 16:57:00.000000000 -0700
@@ -17,18 +17,22 @@ constant(name=Nullch)
     ALIAS:
     ORA_VARCHAR2 =   1
     ORA_NUMBER  =   2
+    ORA_STRING  =   5
     ORA_LONG    =   8
     ORA_ROWID   =  11
     ORA_DATE    =  12
     ORA_RAW     =  23
     ORA_LONGRAW         =  24
     ORA_CHAR    =  96
+    ORA_CHARZ   =  97
     ORA_MLSLABEL = 105
     ORA_NTY     = 108
     ORA_CLOB    = 112
     ORA_BLOB    = 113
     ORA_RSET    = 116
     ORA_OCI      = DBD_ORA_OCI
+    ORA_SYSDBA  = 2
+    ORA_SYSOPER         = 4
     CODE:
     if (!ix) {
        if (!name) name = GvNAME(CvGV(cv));
--- Todo-1      2001-08-30 02:08:26.000000000 -0700
+++ Todo        2002-09-12 17:09:25.000000000 -0700
@@ -10,8 +10,6 @@ of char/varchar types.
 
 add docs about OPS$ login
 
-bind type 1 or 5?!
-
 Add hint about SQL*Plus commands if execute gets an ORA-0900 invalid SQL
 statement? Maybe just if common SQL*Plus command word is first word.
 
@@ -30,10 +28,6 @@ and add "refer to oracle docs or use 'oe
 
 blob_read for oci8 with LONGs
 
-connect(..., { ora_module_name => $0 });
-
-bind_param(... { TYPE => SQL_* }) esp SQL_LONGVARCHAR etc
-
 $sth = $dbh->prepare("select ... for update");
 $dbh->commit;
 $sth->execute; # fails ? auto-re-prepare?
@@ -53,4 +47,3 @@ RAW types at max length
 http://www.oracle-users.com/html/freeware.html
 
 http://freespace.virgin.net/j.hatcher/ociwrap.htm
-

Reply via email to