.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Rose::DB::Oracle 3pm" .TH Rose::DB::Oracle 3pm "2023-03-04" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Rose::DB::Oracle \- Oracle driver class for Rose::DB. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Rose::DB; \& \& Rose::DB\->register_db \& ( \& domain => \*(Aqdevelopment\*(Aq, \& type => \*(Aqmain\*(Aq, \& driver => \*(AqOracle\*(Aq, \& database => \*(Aqdev_db\*(Aq, \& host => \*(Aqlocalhost\*(Aq, \& username => \*(Aqdevuser\*(Aq, \& password => \*(Aqmysecret\*(Aq, \& ); \& \& Rose::DB\->register_db \& ( \& domain => \*(Aqproduction\*(Aq, \& type => \*(Aqmain\*(Aq, \& driver => \*(AqOracle\*(Aq, \& service => \*(Aqmy_pdb\*(Aq, \& host => \*(Aqdb.example.com\*(Aq, \& username => \*(Aqproduser\*(Aq, \& password => \*(Aqprodsecret\*(Aq, \& ); \& \& Rose::DB\->default_domain(\*(Aqdevelopment\*(Aq); \& Rose::DB\->default_type(\*(Aqmain\*(Aq); \& ... \& \& $db = Rose::DB\->new; # $db is really a Rose::DB::Oracle\-derived object \& ... .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Rose::DB blesses objects into a class derived from Rose::DB::Oracle when the driver is \*(L"oracle\*(R". This mapping of driver names to class names is configurable. See the documentation for Rose::DB's \fBnew()\fR and \fBdriver_class()\fR methods for more information. .PP This class cannot be used directly. You must use Rose::DB and let its \fBnew()\fR method return an object blessed into the appropriate class for you, according to its \fBdriver_class()\fR mappings. .PP Only the methods that are new or have different behaviors than those in Rose::DB are documented here. See the Rose::DB documentation for the full list of methods. .PP \&\fBOracle 9 or later is required.\fR .PP If you want to connect to a service rather than a database, use the \f(CW\*(C`service\*(C'\fR parameter instead of \f(CW\*(C`database\*(C'\fR when registering the data source, as shown in the \s-1SYNOPSIS\s0 above. This will allow you to connect to PDBs (Pluggable Databases). .PP \&\fBNote:\fR This class is a work in progress. Support for Oracle databases is not yet complete. If you would like to help, please contact John Siracusa at siracusa@gmail.com or post to the mailing list. .SH "CLASS METHODS" .IX Header "CLASS METHODS" .IP "\fBdefault_post_connect_sql [\s-1STATEMENTS\s0]\fR" 4 .IX Item "default_post_connect_sql [STATEMENTS]" Get or set the default list of \s-1SQL\s0 statements that will be run immediately after connecting to the database. \s-1STATEMENTS\s0 should be a list or reference to an array of \s-1SQL\s0 statements. Returns a reference to the array of \s-1SQL\s0 statements in scalar context, or a list of \s-1SQL\s0 statements in list context. .Sp The default_post_connect_sql statements will be run before any statements set using the post_connect_sql method. The default list contains the following: .Sp .Vb 3 \& ALTER SESSION SET NLS_DATE_FORMAT = \*(AqYYYY\-MM\-DD HH24:MI:SS\*(Aq \& ALTER SESSION SET NLS_TIMESTAMP_FORMAT = \*(AqYYYY\-MM\-DD HH24:MI:SS.FF\*(Aq \& ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT = \*(AqYYYY\-MM\-DD HH24:MI:SS.FF TZHTZM\*(Aq .Ve .Sp If one or more \f(CW\*(C`NLS_*_FORMAT\*(C'\fR environment variables are set, the format strings above are replaced by the values that these environment variables have \fIat the time this module is loaded\fR. .IP "\fBbooleans_are_numeric [\s-1BOOL\s0]\fR" 4 .IX Item "booleans_are_numeric [BOOL]" Get or set a boolean value that indicates whether or not boolean columns are numeric. Oracle does not have a dedicated boolean column type. Two common stand-in column types are \s-1\fBCHAR\s0\fR\|(1) and \s-1\fBNUMBER\s0\fR\|(1). If \f(CW\*(C`booleans_are_numeric\*(C'\fR is true, then boolean columns are treated as \s-1\fBNUMBER\s0\fR\|(1) columns containing either 1 or 0. If false, they are treated as \s-1\fBCHAR\s0\fR\|(1) columns containing either 't' or 'f'. The default is false. .SH "OBJECT METHODS" .IX Header "OBJECT METHODS" .IP "\fBpost_connect_sql [\s-1STATEMENTS\s0]\fR" 4 .IX Item "post_connect_sql [STATEMENTS]" Get or set the \s-1SQL\s0 statements that will be run immediately after connecting to the database. \s-1STATEMENTS\s0 should be a list or reference to an array of \s-1SQL\s0 statements. Returns a reference to an array (in scalar) or a list of the default_post_connect_sql statements and the post_connect_sql statements. Example: .Sp .Vb 1 \& $db\->post_connect_sql(\*(AqUPDATE mytable SET num = num + 1\*(Aq); \& \& print join("\en", $db\->post_connect_sql); \& \& ALTER SESSION SET NLS_DATE_FORMAT=\*(AqYYYY\-MM\-DD HH24:MI:SS\*(Aq \& ALTER SESSION SET NLS_TIMESTAMP_FORMAT=\*(AqYYYY\-MM\-DD HH24:MI:SSxFF\*(Aq \& UPDATE mytable SET num = num + 1 .Ve .IP "\fBschema [\s-1SCHEMA\s0]\fR" 4 .IX Item "schema [SCHEMA]" Get or set the database schema name. In Oracle, every user has a corresponding schema. The schema is comprised of all objects that user owns, and has the same name as that user. Therefore, this attribute defaults to the username if it is not set explicitly. .SS "Value Parsing and Formatting" .IX Subsection "Value Parsing and Formatting" .IP "\fBvalidate_date_keyword \s-1STRING\s0\fR" 4 .IX Item "validate_date_keyword STRING" Returns true if \s-1STRING\s0 is a valid keyword for the PostgreSQL \*(L"date\*(R" data type. Valid (case-insensitive) date keywords are: .Sp .Vb 6 \& current_date \& current_timestamp \& localtimestamp \& months_between \& sysdate \& systimestamp .Ve .Sp The keywords are case sensitive. Any string that looks like a function call (matches \f(CW\*(C`/^\ew+\e(.*\e)$/\*(C'\fR) is also considered a valid date keyword if keyword_function_calls is true. .IP "\fBvalidate_timestamp_keyword \s-1STRING\s0\fR" 4 .IX Item "validate_timestamp_keyword STRING" Returns true if \s-1STRING\s0 is a valid keyword for the Oracle \*(L"timestamp\*(R" data type, false otherwise. Valid timestamp keywords are: .Sp .Vb 6 \& current_date \& current_timestamp \& localtimestamp \& months_between \& sysdate \& systimestamp .Ve .Sp The keywords are case sensitive. Any string that looks like a function call (matches \f(CW\*(C`/^\ew+\e(.*\e)$/\*(C'\fR) is also considered a valid timestamp keyword if keyword_function_calls is true. .SH "AUTHORS" .IX Header "AUTHORS" John C. Siracusa (siracusa@gmail.com), Ron Savage (ron@savage.net.au) .SH "LICENSE" .IX Header "LICENSE" Copyright (c) 2008 by John Siracusa and Ron Savage. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.