Skip to Main Content
Ted Struik - Oracle
Search For
Home
Home
Ted Struik - Oracle
Search
Site Map
Statistics
Page Errors
Apex
Apex
General
Autocomplete
Conditions
Errors
Items used in PL/SQL
Validations
Dynamic Actions
Logs
Version
App-wide Items
Error Handling
Apex Views
Apex Upgrade 4.2 to 5.1
Apex Upgrade 20.2 to 23.1
Database Dependencies
Show Source Code
URLs
Authorization
Modal Dialogs
Apex Office Print (AOP)
Apex-Sert
Warn on Unsaved Changes
Form Regions
Breadcrumbs
Reports
Checkboxes
Download
Errors
Nowrap Columns
Substitution Strings
Use IR results in pl/sql
Clickable Row
Row Highlight
Translate Filters etc.
Bar Charts
Column Usage
Reset Pagination
Hide IR Actions menu items
Get Classic Report query
Sorting strings as numbers
Search needs Filters
Interactive Grid
ORA-20987
ERR-1002
Copying Text
IG Info
Multiple Row Select
Read Only Options
Search
Sort and Search
Page Items to Submit
Single Row View
Popup LOV Sorting
Images & Fonts
Standard Icons & Fonts
WebDav
Font Awesome
Icons/image popup LOV
Lists
Hierarchy
LOVs
Definition Bug
Set 1-item LOV to Disabled
With Clause Errors
Modal LOV Plugin
HTML / CSS / JavaScript
Vertical Align
Legend CSS
Geolocation
Apex.confirm
Pie Charts
Codemirror
Theme Roller
Catching Key Strokes
Browser Cache
Locale
RequireJS
Collapsible Regions
Find JavaScript (or CSS)
Import / Export
Dynamic Translations
Translated Pages
APEXExport (java)
apex_export (pl/sql)
Component Settings
Charts
Translate Charts
[Reports] Bar Charts
Shuttles
Shuttle Sorting
Disable Shuttle Items
Menus
Accordion-Like
Scroll bug
Authorization
Session State
About Session State
Rollback & Commit
Performance of v()
Apex Clone Session
Request
Session State in Views
Collections
ORA-20101 & ORA-20104
ORA-00001
Max Row Count
ORA-02291
(PL)SQL
(PL)SQL
External Tables
SQL Plus
Conditions
Long
ORDImage
Date & Timestamp
CGI environment
Sys_context
Rounding percentages
Apex_string.split in SQL
Dbms_metadata
Instr
Regular Expressions
Rollback to Savepoint
Use table aliases
(Pipelined) Bulk Collect
JSON
Source Code Search (PL/SQL)
Source Code Search (SQL)
Format Models
Pipelined Table Functions
Hint no_unnest
Listagg
(Re)compile Objects
HTML
LLM
DBA
DBA
Backup & Restore
Users
Export & Import
DBMS Jobs
Tablespaces
Table Size
Flush cache
Access Control List (ACL)
Locks
Java
Constraints
Object Dependencies
Package Dependencies 1
Package Dependencies 2
Grants
SQL History
Startup Errors
ORDS
Synonyms
Miscellaneous
Miscellaneous
Holidays
E-mail
NLExtract
Windows
VPN
VMware
Links
Google
Visualization Orgchart
Hide Search Results
Reverse Proxy
To-do List
Cytoscape
Graphics
Upscaling
Amazon Prices
Domoticz
DDoS
Hobbies
Hobbies
Motorcycles
'95 Kawasaki ZZR 600
'94 Kawasaki ZZR 1100
'91 Honda CBR 600 F2
'95 Kawasaki ZZR 1100
'99 Honda CBR 1100 XX
'00 Honda CBR 1100 XX
'02 Kawasaki ZX-12R (NL)
'05 Ducati 999 (NL)
'08 Honda Fireblade
'07 Suzuki Bandit 1250A
'18 Suzuki GSX-S 1000 F
MotoGP
Garfield
Lyrics
Skydive
Woodworking
Pantorouter
16 inch Bandsaw
Introduction
Frame
Wheels
Wheel mounts
Blade guides
Trunions and table
Enclosure
Alignment and more
Box Joint Jig
Foldable Sawhorses
Strip Sander XL
Sony RX10 IV
Yes Minister
WinAmp
Focal Onyx
Creating PL/SQL with LLMs
I've been playing around with local LLMs that are supposed to be good at coding, to see if they could be useful for creating PL/SQL code.
To see what is possible at this moment in time, I used LM Studio to ask some local LLMs one simple question:
"write an oracle pl/sql function to calculate the date of Easter sunday"
If you really want to dive into that one:
https://en.wikipedia.org/wiki/Date_of_Easter
.
Of course this is a very limited test; just one question and a very limited number of LLM models.
But it's a lot of fun to run them locally and see what a fairly powerful PC (AMD Ryzen 9 5900X, 64 GB RAM, Nvidia 5060 Ti with 16 GB VRAM) can do.
And with most models, if you point out the obvious mistakes they will correct them (most of the time), leaving you with useable code - or at least, something you can rework into something useful.
I created a package with all the "first pl/sql result" functions the LLMs generated, so without any fine-tuning done.
Some results needed tweaking to get them to compile; I noted those changes, and added my comments, in the functions themselves. Check out the code below.
Since I already have a
page to calculate Easter sunday
, comparing that code and the results (if any) of the code generated by the LLMs is easy enough.
In the "Models and Results" overview below, I listed the models and variants I tested, plus some test results (for 1538 and 4909, which are the limits of the Gregorian calendar, and some years around now).
Only 4 functions produced any results, of which only 3 got it right most of the time.
For the year 4909, those 3 got a different result than my own function (which says April 13th instead of 14th).
Since those 3 agreed with each other, I assume my function is wrong on that one - but I haven't found a source online I trust 100% to verify this.
Models and Results
Model Name
Variant
Size (GB)
Parameters (B)
Verdict
R 1583
R 2026
R 2027
R 2028
R 2029
R 2030
R 2031
R 2032
R 4909
essentialai/rnj-1
Q8_0
8.8
8.3
1583-04-10
2026-04-05
2027-03-28
2028-04-16
2029-04-01
2030-04-21
2031-04-13
2032-03-28
4909-04-14
google/gemma-3-27b
Q4_0
16.4
27
google/gemma-3-4b
Q4_K_M
3.3
4
google/gemma-3n-e4b
Q8_0
7.4
6.9
1583-04-10
2026-04-05
2027-03-28
2028-04-16
2029-04-01
2030-04-21
2031-04-13
2032-03-28
4909-04-14
mistralai/devstral-small-2-2512
F16
48
24
mistralai/devstral-small-2-2512
Q3_K_L
13.3
24
1583-03-18
2026-03-22
2027-03-21
2028-03-20
2029-03-20
2030-03-19
2031-03-25
2032-03-25
4909-03-10
qwen/qwen3-coder-next
Q4_K_M
48.5
80
1583-04-10
2026-04-05
2027-03-28
2028-04-16
2029-04-01
2030-04-21
2031-04-13
2032-03-28
4909-04-14
qwen/qwen3.5-35b-a3b
Q4_K_M
22.1
35
qwen/qwen3.5-35b-a3b
Q8_0
37.8
35
zai-org/glm-4.7-flash
Q8_0
31.8
30
Code
Region
Identification
Sequence
20
Title
Models and Results
Type
Report
Source
Location
Local Database
Query Type
Table
Table Name
TED_P1199_V
View
View
Name
TED_P1199_V
DDL
with iv_m as ( select 'essentialai/rnj-1' as model_name, 'Q8_0' as variant, 8.8 as size_gb, 8.3 as parameters, 90 as verdict from dual union all select 'google/gemma-3-27b' as model_name, 'Q4_0' as variant, 16.4 as size_gb, 27 as parameters, 20 as verdict from dual union all select 'google/gemma-3-4b' as model_name, 'Q4_K_M' as variant, 3.3 as size_gb, 4 as parameters, 20 as verdict from dual union all select 'google/gemma-3n-e4b' as model_name, 'Q8_0' as variant, 7.4 as size_gb, 6.9 as parameters, 85 as verdict from dual union all select 'mistralai/devstral-small-2-2512' as model_name, 'F16' as variant, 48 as size_gb, 24 as parameters, 40 as verdict from dual union all select 'mistralai/devstral-small-2-2512' as model_name, 'Q3_K_L' as variant, 13.3 as size_gb, 24 as parameters, 40 as verdict from dual union all select 'qwen/qwen3-coder-next' as model_name, 'Q4_K_M' as variant, 48.5 as size_gb, 80 as parameters, 90 as verdict from dual union all select 'qwen/qwen3.5-35b-a3b' as model_name, 'Q4_K_M' as variant, 22.1 as size_gb, 35 as parameters, 40 as verdict from dual union all select 'qwen/qwen3.5-35b-a3b' as model_name, 'Q8_0' as variant, 37.8 as size_gb, 35 as parameters, 50 as verdict from dual union all select 'zai-org/glm-4.7-flash' as model_name, 'Q8_0' as variant, 31.8 as size_gb, 30 as parameters, 10 as verdict from dual ) select iv_m.model_name , iv_m.variant , iv_m.size_gb , iv_m.parameters , iv_m.verdict , ted_p1199.get_easter(in_model_name => iv_m.model_name, in_variant => iv_m.variant, in_year => 1583) as r_1583 , ted_p1199.get_easter(in_model_name => iv_m.model_name, in_variant => iv_m.variant, in_year => 2026) as r_2026 , ted_p1199.get_easter(in_model_name => iv_m.model_name, in_variant => iv_m.variant, in_year => 2027) as r_2027 , ted_p1199.get_easter(in_model_name => iv_m.model_name, in_variant => iv_m.variant, in_year => 2028) as r_2028 , ted_p1199.get_easter(in_model_name => iv_m.model_name, in_variant => iv_m.variant, in_year => 2029) as r_2029 , ted_p1199.get_easter(in_model_name => iv_m.model_name, in_variant => iv_m.variant, in_year => 2030) as r_2030 , ted_p1199.get_easter(in_model_name => iv_m.model_name, in_variant => iv_m.variant, in_year => 2031) as r_2031 , ted_p1199.get_easter(in_model_name => iv_m.model_name, in_variant => iv_m.variant, in_year => 2032) as r_2032 , ted_p1199.get_easter(in_model_name => iv_m.model_name, in_variant => iv_m.variant, in_year => 4909) as r_4909 from iv_m
Package
Package
Name
TED_P1199
Source
package ted_p1199 is FUNCTION essentialai_rnj_1_Q8_0(year IN NUMBER) RETURN DATE; FUNCTION google_gemma_3_27b_Q4_0 (year IN NUMBER) RETURN DATE; FUNCTION google_gemma_3_4b_Q4_K_M(in_year in pls_integer) RETURN DATE DETERMINISTIC; FUNCTION google_gemma_3n_e4b_Q8_0(p_year IN NUMBER) RETURN DATE; FUNCTION mistralai_devstral_small_2_2512_F16(p_year IN NUMBER) RETURN DATE; FUNCTION mistralai_devstral_small_2_2512_Q3_K_L(p_year IN NUMBER) RETURN DATE; FUNCTION qwen_qwen3_coder_next_Q4_K_M(p_year IN PLS_INTEGER) RETURN DATE; FUNCTION qwen_qwen3_5_35b_a3b_Q4_K_M(p_year NUMBER) RETURN DATE; FUNCTION qwen_qwen3_5_35b_a3b_Q8_0(p_year IN NUMBER) RETURN DATE; function zai_org_glm_4_7_flash_Q8_0(in_year in pls_integer) return date; function get_easter ( in_model_name in varchar2 ,in_variant in varchar2 ,in_year in pls_integer ) return date deterministic; end ted_p1199;
Package Body
Package Body
Name
TED_P1199
Source
package body ted_p1199 is FUNCTION essentialai_rnj_1_Q8_0(year IN NUMBER) RETURN DATE IS a NUMBER; b NUMBER; c NUMBER; d NUMBER; e NUMBER; f NUMBER; g NUMBER; h NUMBER; i NUMBER; k NUMBER; l NUMBER; m NUMBER; month_number NUMBER; day_number NUMBER; BEGIN a := MOD(year, 19); b := FLOOR(year / 100); c := MOD(year, 100); d := FLOOR(b / 4); e := MOD(b, 4); f := FLOOR((b + 8) / 25); g := FLOOR((b - f + 1) / 3); h := MOD(19 * a + b - d - g + 15, 30); i := FLOOR(c / 4); k := MOD(c, 4); l := MOD(32 + 2 * e + 2 * i - h - k, 7); m := FLOOR((a + 11 * h + 22 * l) / 451); month_number := FLOOR((h + l - 7 * m + 114) / 31); day_number := MOD(h + l - 7 * m + 114, 31) + 1; RETURN TO_DATE('01-' || TO_CHAR(month_number) || '-' || year, 'DD-MM-YYYY') + (day_number - 1); /* Perfect! Result is April 5th 2026. I tested some other years as well and it worked for all of them. I did need to give it some more information however. After the original prompt it replied: "It seems like there is a bit of confusion in the question since you've asked for a Python code solution while the title mentions Oracle PL/SQL. However, I'll assume that you want a Python implementation to calculate the date of Easter Sunday." No idea why it would think that, but it did produce some Python code. I gave a further prompt: "I need this in oracle pl/sql", after which it produced the code shown above. Note that there is no check to validate the year. */ END; -- google_gemma_3_27b_Q4_0 FUNCTION google_gemma_3_27b_Q4_0 (year IN NUMBER) RETURN DATE IS a NUMBER; b NUMBER; c NUMBER; d NUMBER; e NUMBER; f NUMBER; g NUMBER; h NUMBER; i NUMBER; j NUMBER; m NUMBER; day NUMBER; month NUMBER; BEGIN /* -- Calculate the values based on Gauss's algorithm a := year DIV 100; b := a DIV 4; c := a MOD 4; d := (year + 8) DIV 25; e := (year - d + 1) DIV 3; f := (year - 4 * b + c) MOD 7; g := year + e - d; h := g MOD 7; -- Calculate the day of the month for Easter Sunday i := (23 * h + 15) DIV 7; m := i; -- Determine the month and day IF m = 28 THEN day := 31; month := 4; -- April ELSIF m = 29 THEN day := 6; month := 4; -- April ELSIF m = 30 THEN day := 5; month := 4; -- April ELSIF m = 31 THEN day := 4; month := 4; -- April ELSE day := 24; month := 3; -- March END IF; -- Return the date of Easter Sunday for the given year RETURN TO_DATE(TO_CHAR(year, 'YYYY') || '-' || LPAD(month, 2, '0') || '-' || LPAD(day, 2, '0'), 'YYYY-MM-DD'); */ /* Apart from the invalid DIV functions, the rest of the calculation is never going to work... */ return null; EXCEPTION WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20001, 'Invalid year. Year must be a positive integer.'); END; FUNCTION google_gemma_3_4b_Q4_K_M(in_year in pls_integer) RETURN DATE DETERMINISTIC AS -- Added DETERMINISTIC for better performance and predictability year NUMBER; a NUMBER; b NUMBER; c NUMBER; d NUMBER; e NUMBER; f NUMBER; g NUMBER; h NUMBER; i NUMBER; BEGIN /* -- Get the current year year := TRUNC(SYSDATE); -- Calculate Easter date using the algorithm a := year; b := a % 4; c := a % 100; d := a % 400; e := (19 * a) / 330; f := (5 * a) / 16; g := (a + 12) / 365.25; h := (a + 12) % 365.25; i := e + f + g + h; -- Calculate the day of Easter Sunday based on the calculated date RETURN DATE '2000-03-28' + i - 7; -- Adjust for March 28th as a reference point */ /* The code won't run, so I commented it out; there are quite a few problems here: A YEAR input parameter was missing, so I added one. The first line (FUNCTION...) was misshapen (I fixed it to get the package to compile) and the fourth line was DECLARE, which is nonsense. Invalid: "b := a % 4;" - I assume it means "b = mod(a, 4)". Invalid: "year := TRUNC(SYSDATE)" - I assume it means "year := extract(year from SYSDATE)". Invalid: "RETURN DATE '2000-03-28' + i - 7" - I assume it means "RETURN to_date('2000-03-28','YYYY-MM-DD') + i - 7" With those fixes in place, the result for 2026 would November 13th 2002... Apart from the coding errors, the calculation itself seems way too simple compared to the correct one(s). But this is a very small model, so this was to be expected. */ return null; END; FUNCTION google_gemma_3n_e4b_Q8_0(p_year IN NUMBER) RETURN DATE IS l_a NUMBER; l_b NUMBER; l_c NUMBER; l_d NUMBER; l_e NUMBER; l_f NUMBER; l_g NUMBER; l_h NUMBER; l_i NUMBER; l_k NUMBER; l_l NUMBER; l_m NUMBER; l_day NUMBER; l_month NUMBER; BEGIN -- Validate input year (optional, adjust range as needed) IF p_year < 1583 THEN RAISE_APPLICATION_ERROR(-20001, 'Algorithm valid only for years >= 1583 (Gregorian calendar).'); END IF; -- Meeus/Jones/Butcher algorithm (Gregorian calendar) l_a := MOD(p_year, 19); l_b := FLOOR(p_year / 100); l_c := MOD(p_year, 100); l_d := FLOOR(l_b / 4); l_e := MOD(l_b, 4); l_f := FLOOR((l_b + 8) / 25); l_g := FLOOR((l_b - l_f + 1) / 3); l_h := MOD(19 * l_a + l_b - l_d - l_g + 15, 30); -- Correction for certain moon calculations: IF l_h = 29 OR (l_h = 28 AND l_a > 11) THEN l_h := l_h - 1; END IF; l_i := FLOOR(l_c / 4); l_k := MOD(l_c, 4); l_l := MOD(32 + 2 * l_e + 2 * l_i - l_h - l_k, 7); l_m := FLOOR((l_a + 11 * l_h + 22 * l_l) / 451); -- Compute month and day l_month := FLOOR((l_h + l_l - 7 * l_m + 114) / 31); l_day := MOD(l_h + l_l - 7 * l_m + 114, 31) + 1; -- # ORIGINAL: RETURN TO_DATE(p_year || '-' || TO_CHAR(l_month, '01') || '-' || TO_CHAR(l_day, '01'), 'YYYY-MM-DD'); RETURN TO_DATE(p_year || '-' || TO_CHAR(l_month, '00') || '-' || TO_CHAR(l_day, '00'), 'YYYY-MM-DD'); /* Apart from the TO_CHAR '01' issue I fixed above, this works great. Note that there is a check to validate "year >= 1538", but no "year <= 4909". */ END; FUNCTION mistralai_devstral_small_2_2512_F16(p_year IN NUMBER) RETURN DATE IS a NUMBER; b NUMBER; c NUMBER; d NUMBER; e NUMBER; f NUMBER; g NUMBER; h NUMBER; i NUMBER; k NUMBER; l NUMBER; m NUMBER; BEGIN -- Gaussian algorithm for calculating Easter Sunday a := p_year MOD 19; b := FLOOR(p_year / 100); c := p_year MOD 100; d := FLOOR(b / 4); e := b MOD 4; f := FLOOR((b + 8) / 25); g := FLOOR((b - f + 1) / 3); h := (19 * a + b - d - g + 15) MOD 30; i := c; i := FLOOR(c / 4); k := c MOD 4; l := (32 + 2 * e + 2 * i - h - k) MOD 7; m := FLOOR((a + 11 * h + 22 * l) / 451); /* -- Calculate the month and day IF (h + l - 7 * m + 114) <= 0 THEN RETURN TO_DATE('03/' || (h + l - 7 * m + 114 + 31) || '/' || p_year, 'DD/MM/YYYY'); ELSE RETURN TO_DATE((h + l - 7 * m + 114) || '/04/' || p_year, 'DD/MM/YYYY'); END IF; */ /* The calculations done in the IF statement are never going to work; the calculated day or month are way too big. Also in the ELSE section the day and month seem to be reversed in the TO_DATE. */ return null; END; FUNCTION mistralai_devstral_small_2_2512_Q3_K_L(p_year IN NUMBER) RETURN DATE IS -- Function to calculate Easter Sunday date using the Gaussian algorithm -- Returns NULL if p_year is not between 1583 and 4909 (Gregorian calendar range) BEGIN -- Validate input year range IF p_year < 1583 OR p_year > 4909 THEN RETURN NULL; END IF; -- Gaussian algorithm calculations DECLARE a NUMBER := p_year MOD 19; b NUMBER := FLOOR(p_year / 100); c NUMBER := p_year MOD 100; d NUMBER := FLOOR(b / 3); e NUMBER := FLOOR(11 * a + 20) MOD 30; f NUMBER := FLOOR(c / 4); g NUMBER := FLOOR((b + 8) / 25); h NUMBER := FLOOR((b - g + 1) / 3); i NUMBER := ((a + 11 * e + 22 * d) MOD 4) + b; j NUMBER := FLOOR(c / 4); k NUMBER := ((3 * e + c - i) MOD 7) + 28; m NUMBER := FLOOR((b - g + 1) / 3); n NUMBER := (i + k) MOD 31; BEGIN -- Return the calculated date (March or April) RETURN TO_DATE('03-' || LPAD(TO_CHAR(n), 2, '0') || '-' || p_year, 'MM-DD-YYYY'); END; /* The code runs, and the result is close, but incorrect: March 22nd 2026. Note that March is hardcoded, although April is mentioned as a possibility in the comment. */ END; FUNCTION qwen_qwen3_coder_next_Q4_K_M(p_year IN PLS_INTEGER) RETURN DATE IS l_a PLS_INTEGER; l_b PLS_INTEGER; l_c PLS_INTEGER; l_d PLS_INTEGER; l_e PLS_INTEGER; l_f PLS_INTEGER; l_g PLS_INTEGER; l_h PLS_INTEGER; l_i PLS_INTEGER; l_k PLS_INTEGER; l_l PLS_INTEGER; l_m PLS_INTEGER; l_day PLS_INTEGER; l_month PLS_INTEGER; BEGIN -- Validate input year (optional; adjust range as needed) IF p_year < 1583 THEN RAISE_APPLICATION_ERROR(-20001, 'Algorithm valid only for years >= 1583 (Gregorian calendar).'); END IF; -- Meeus/Jones/Butcher algorithm (Gregorian calendar) l_a := MOD(p_year, 19); l_b := FLOOR(p_year / 100); l_c := MOD(p_year, 100); l_d := FLOOR(l_b / 4); l_e := MOD(l_b, 4); l_f := FLOOR((l_b + 8) / 25); l_g := FLOOR((l_b - l_f + 1) / 3); l_h := MOD(19 * l_a + l_b - l_d - l_g + 15, 30); -- Correction for certain moon calculations: IF l_h = 29 OR (l_h = 28 AND l_a > 11) THEN l_h := l_h - 1; END IF; l_i := FLOOR(l_c / 4); l_k := MOD(l_c, 4); l_l := MOD(32 + 2 * l_e + 2 * l_i - l_h - l_k, 7); l_m := FLOOR((l_a + 11 * l_h + 22 * l_l) / 451); -- Compute month and day l_month := FLOOR((l_h + l_l - 7 * l_m + 114) / 31); l_day := MOD(l_h + l_l - 7 * l_m + 114, 31) + 1; -- # ORIGINAL: RETURN MAKE_DATE(p_year, l_month, l_day); RETURN to_date(p_year||to_char(l_month,'fm00')|| to_char(l_day,'fm00'),'YYYYMMDD'); /* Obviously MAKE_DATE is not a valid function, so I fixed that - but apart from that is works great. Note that there is a check to validate "year >= 1538", but no "year <= 4909". */ END; FUNCTION qwen_qwen3_5_35b_a3b_Q4_K_M(p_year NUMBER) RETURN DATE IS -- Variables for the computus algorithm a NUMBER; b NUMBER; c NUMBER; d NUMBER; e NUMBER; f NUMBER; g NUMBER; h NUMBER; i NUMBER; j NUMBER; k NUMBER; l NUMBER; -- Result month and day easter_month NUMBER := 3; easter_day NUMBER := 25; BEGIN -- Validate input year IF p_year < 1583 THEN RAISE_APPLICATION_ERROR(-20001, 'Year must be >= 1583 (Gregorian calendar)'); END IF; a := MOD(p_year, 19); b := FLOOR(p_year / 100); c := MOD(p_year, 100); d := FLOOR(b / 4); e := MOD(b, 4); f := FLOOR((b + 8) / 25); g := FLOOR((b - f + 1) / 3); h := MOD(19 * a + b - d - g + 15, 30); i := MOD(c, 4); k := MOD(h / 28, 1); IF (k = 1 OR k = 0) AND h = 29 THEN l := 29; ELSE l := MOD(7 * (i + FLOOR((h + d - l) / 3)) + FLOOR(p_year / 4), 7); END IF; easter_month := MOD(h + l + 114, 31); easter_day := FLOOR((h + l + 114) / 31); -- Return the date /* RETURN TO_DATE(TO_CHAR(easter_month) || '/' || TO_CHAR(easter_day) || '/' || TO_CHAR(p_year), 'MM/DD/YYYY'); */ /* I commented out the RETURN, because in "l := MOD(7 * (i + FLOOR((h + d - l) / 3)) + FLOOR(p_year / 4), 7);" variable l is referenced in the calculation while it is still null; so all calculations after that return null as well - and the TO_DATE in the RETURN would create an error. Too bad, because the code itself looks promising. */ return null; EXCEPTION WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20002, 'Error calculating Easter: ' || SQLERRM); END; FUNCTION qwen_qwen3_5_35b_a3b_Q8_0(p_year IN NUMBER) RETURN DATE IS a NUMBER; b NUMBER; c NUMBER; d NUMBER; e NUMBER; f NUMBER; g NUMBER; h NUMBER; i NUMBER; j NUMBER; k NUMBER; l NUMBER; m NUMBER; n NUMBER; BEGIN -- Validate input year IF p_year < 1583 THEN RAISE_APPLICATION_ERROR(-20001, 'Year must be 1583 or later (Gregorian calendar)'); END IF; a := MOD(p_year, 19); b := FLOOR(15 * p_year / 4); c := FLOOR((b - 16) / 4); d := MOD(FLOOR(b + 8) / 25, 30); e := MOD(d / 5, 3); f := FLOOR(9 * p_year / 4); g := FLOOR((f - c) / 3); h := MOD(a * (19 + d - e) - g, 30); i := FLOOR(h / 28); j := MOD(i, 3); -- Adjust for special cases in the algorithm IF h = 29 AND j = 6 THEN l := 1; ELSE l := MOD(FLOOR(7 * (h + 1) - i), 7); END IF; m := FLOOR(p_year / 400) - FLOOR(p_year / 100) + FLOOR(p_year / 4); n := 20 + h - l; -- Check if Easter falls in April or March /* IF n < 32 THEN RETURN TO_DATE(TO_CHAR(p_year) || '-03-' || LPAD(n, 2, '0'), 'YYYY-MM-DD'); ELSE RETURN TO_DATE(TO_CHAR(p_year) || '-04-' || LPAD(n - 31, 2, '0'), 'YYYY-MM-DD'); END IF; */ /* I commented out the last IF statement, because e.g. for 2026, n equals 5.32, so the TO_DATE fails. If I force n to be an integer using floor(), the result is March 5th 2026. Close but no cigar. Also note that m is calculated but never used after that. */ return null; EXCEPTION WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20002, 'Error calculating Easter Sunday: ' || SQLERRM); END; function zai_org_glm_4_7_flash_Q8_0(in_year in pls_integer) return date is begin /* Watching it come up with all sorts of solutions, and then rejecting them, correcting itself, and trying again, over and over, was fun - but also a bit creepy... But more importantly, it got itself stuck in a loop, generate the same lines of reasoning over and over again, not getting any closer to a solution. So after about 15 minutes I decided to put it out of its misery. */ return null; end; -- My own function(s) needed for the page: function get_easter ( in_model_name in varchar2 ,in_variant in varchar2 ,in_year in pls_integer ) return date deterministic is l_return date; begin l_return := (case in_model_name || '_' || in_variant when 'essentialai/rnj-1_Q8_0' then ted_p1199.essentialai_rnj_1_q8_0(in_year) when 'google/gemma-3-27b_Q4_0' then ted_p1199.google_gemma_3_27b_q4_0(in_year) when 'google/gemma-3-4b_Q4_K_M' then ted_p1199.google_gemma_3_4b_q4_k_m(in_year) when 'google/gemma-3n-e4b_Q8_0' then ted_p1199.google_gemma_3n_e4b_q8_0(in_year) when 'mistralai/devstral-small-2-2512_Q3_K_L' then ted_p1199.mistralai_devstral_small_2_2512_q3_k_l(in_year) when 'mistralai/devstral-small-2-2512_F16' then ted_p1199.mistralai_devstral_small_2_2512_f16(in_year) when 'qwen/qwen3-coder-next_Q4_K_M' then ted_p1199.qwen_qwen3_coder_next_q4_k_m(in_year) when 'qwen/qwen3.5-35b-a3b_Q4_K_M' then ted_p1199.qwen_qwen3_5_35b_a3b_q4_k_m(in_year) when 'qwen/qwen3.5-35b-a3b_Q8_0' then ted_p1199.qwen_qwen3_5_35b_a3b_q8_0(in_year) when 'zai-org/glm-4.7-flash_Q8_0' then ted_p1199.zai_org_glm_4_7_flash_q8_0(in_year) else to_date(null) end); return l_return; end get_easter; end ted_p1199;