Rose::DB::Oracle(3pm)
β¨ Rose::DB::Oracle(3pm) β¨
okay bestie gather round π this is the Rose::DB::Oracle manual page β it's the Oracle driver class for Rose::DB, which is a Perl thing, iykyk. no cap, it's giving "database but make it dramatic." let's get into it π¦
πΈ NAME πΈ
Rose::DB::Oracle β literally just the Oracle driver class for Rose::DB. that's the whole name. short, sweet, iconic π
π SYNOPSIS π
use Rose::DB;
Rose::DB->register_db
(
domain => 'development',
type => 'main',
driver => 'Oracle',
database => 'dev_db',
host => 'localhost',
username => 'devuser',
password => 'mysecret',
);
Rose::DB->register_db
(
domain => 'production',
type => 'main',
driver => 'Oracle',
service => 'my_pdb',
host => 'db.example.com',
username => 'produser',
password => 'prodsecret',
);
Rose::DB->default_domain('development');
Rose::DB->default_type('main');
...
$db = Rose::DB->new; # $db is really a Rose::DB::Oracle-derived object
...
π DESCRIPTION π
so basically, when the driver is "oracle", Rose::DB blesses objects into a class that's derived from Rose::DB::Oracle. β¨ the way that driver names map to class names is configurable β go read the docs for Rose::DB's new() and driver_class() methods if you wanna know more. π
π important bestie: you cannot use this class directly. like, at all. you gotta use Rose::DB and let itsnew()method hand you back an object blessed into the right class for you, based on itsdriver_class()mappings. that's the whole vibe. the class picks you, you don't pick the class π«Ά
only the methods that are new or that behave differently from the ones in Rose::DB are documented here. for the full list of methods, go read the Rose::DB docs. no gatekeeping, just a different page β¨
Oracle 9 or later is required. yes, nine. it's giving retro but make it functional π
if you wanna connect to a service instead of a database, use the "service" parameter instead of database when you register the data source β exactly like the SYNOPSIS up there shows. this lets you connect to PDBs (Pluggable Databases) π¦ iconic, honestly.
π Note: this class is a work in progress. support for Oracle databases is not yet complete. if you wanna help out, please contact John Siracusa at siracusa@gmail.com or post to the mailing list. we love a collaborative moment π
β CLASS METHODS β
default_post_connect_sql [STATEMENTS]β get or set the default list of SQL statements that get run immediately after connecting to the database.STATEMENTSshould be a list, or a reference to an array, of SQL statements. it returns a reference to the array of SQL statements in scalar context</>, or a list of SQL statements in list context</>. π
the default_post_connect_sql statements run before any statements set using the post_connect_sql method. the default list contains exactly this:
ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'
ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF'
ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF TZHTZM'
and here's the lil plot twist bestie: if one or more "NLS_*_FORMAT" environment variables are set, those format strings above get replaced by the values those environment variables have at the time this module is loaded. so like, timing matters. slay β¨
booleans_are_numeric [BOOL]β get or set a boolean that says whether or not boolean columns are numeric. π here's the tea: Oracle doesn't have a dedicated boolean column type. the two common stand-in column types areCHAR(1)andNUMBER(1). so if"booleans_are_numeric"is true, boolean columns are treated asNUMBER(1)columns containing either1or0. if it's false, they're treated asCHAR(1)columns containing either't'or'f'. the default is false. periodt. π
π¦ OBJECT METHODS π¦
post_connect_sql [STATEMENTS]β get or set the SQL statements that will be run immediately after connecting to the database.STATEMENTSshould be a list, or a reference to an array, of SQL statements. it returns a reference to an array (in scalar</> context) or a list of thedefault_post_connect_sqlstatements and thepost_connect_sqlstatements. here's an example, bestie π
$db->post_connect_sql('UPDATE mytable SET num = num + 1');
print join("\n", $db->post_connect_sql);
ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
ALTER SESSION SET NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SSxFF'
UPDATE mytable SET num = num + 1
schema [SCHEMA]β get or set the database schema name. πΈ in Oracle, every user has a corresponding schema. the schema is made up of all the objects that user owns, and it has the same name as that user. so therefore, this attribute defaults to theusernameif it isn't set explicitly. it's giving "you are your schema" main character energy π
π₯ Value Parsing and Formatting π₯
validate_date_keyword STRINGβ returns true ifSTRINGis a valid keyword for the PostgreSQL"date"data type. (yes, it says PostgreSQL, that's literally what the page says, don't come for me bestie π) the valid (case-insensitive) date keywords are:
current_date
current_timestamp
localtimestamp
months_between
sysdate
systimestamp
π and then it says: the keywords are case sensitive. both things. yes. it sayscase-insensitiveand thencase sensitive. we're just reporting the facts, no notes π
any string that looks like a function call (matches "/^\w+\(.*\)$/") is also considered a valid date keyword if keyword_function_calls is true. π
validate_timestamp_keyword STRINGβ returns true ifSTRINGis a valid keyword for the Oracle"timestamp"data type, false otherwise. the valid timestamp keywords are:
current_date
current_timestamp
localtimestamp
months_between
sysdate
systimestamp
the keywords are case sensitive. and again β any string that looks like a function call (matches "/^\w+\(.*\)$/") is also considered a valid timestamp keyword if keyword_function_calls is true. β¨
π AUTHORS π
John C. Siracusa (siracusa@gmail.com), Ron Savage (ron@savage.net.au) β legends, both of them π
π 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. π«Ά legally iconic, no cap.
and that's a wrap bestie!! π this gorgeous lil page comes from Rose::DB::Oracle(3pm) in the User Contributed Perl Documentation, generated by perl v5.40.1 and dated 2026-07-31. go forth and connect to your PDBs π β¨π
π¦ where this page comes from
- ubuntu stonking: librose-db-perl 0.788-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms