Data::...:Oracle(3pm)

πŸ’œ Data::...:Oracle(3pm) β€” like, the whole entire page πŸ’œ

okay bestie, so this is the <pink>User Contributed Perl Documentation</pink> page for Data::ObjectDriver::Driver::DBD::Oracle, and it's genuinely shorter than my attention span, so we're gonna get through it together. pull up a seat 🫢


✨ NAME ✨

Data::ObjectDriver::Driver::DBD::Oracle β€” the Oracle Driver for Data::ObjectDriver. that's it, that's the name, no notes πŸ’…


🌸 DESCRIPTION 🌸

so listen β€” this module overrides methods of the Data::ObjectDriver::Driver::DBD module and swaps in an Oracle specific implementation. basically it takes the regular DBD driver and goes "no babe, we're doing it the Oracle way now." iconic behavior honestly πŸ‘‘


πŸ”₯ NOTES πŸ”₯

okay this is the part you actually need, so pay attention bestie πŸŽ€

Oracle doesn't support auto-increment β€” like, at all, it's just not a thing it does, ngl. so before you use this feature, you need to create a sequence and a trigger to make it work. no cap, it's a two-step situation.

for example (fr fr, this is the actual example): say you want the field ID in table WINES to be auto-increment. then you create:

-- Create sequence
CREATE SEQUENCE WINES_ID_SEQ
MINVALUE 1
MAXVALUE 999999999999999999999999999
START WITH 1
INCREMENT BY 1
NOCACHE;

-- Create trigger
CREATE OR REPLACE TRIGGER WINES_ID_TR
  BEFORE INSERT ON WINES
  FOR EACH ROW
BEGIN
  SELECT WINES_ID_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
END;

the way that sequence has a MAXVALUE of 999999999999999999999999999… she's got range πŸ’€ and NOCACHE because we're not about that cache life apparently. then the trigger swoops in BEFORE INSERT on WINES, FOR EACH ROW, and pulls WINES_ID_SEQ.NEXTVAL into :NEW.ID FROM DUAL. slay. that's the whole trick 🧚


πŸ¦‹ LICENSE πŸ¦‹

this module is free software β€” you may redistribute and/or modify it under the same terms as Perl itself. go off, do your thing πŸ’–


this module is copyright (c) 2009 Xiaoou Wu <xiaoou.wu@oracle.com>. All rights reserved.

like, all of them. every single one πŸ™ˆ


okay and the little footer moment, since you asked: this page is from perl v5.42.0, dated 2024-10-24, and it's filed under Data::...:Oracle(3pm) because even the manpage header got tired and hit the ellipsis πŸ’€βœ¨ that's the whole page bestie, you ate that, periodt πŸŒˆπŸ“

πŸ“¦ where this page comes from