---
title: "Cody Reandeau (@codyreandeau) | Hashnode"
description: "Cody Reandeau (@codyreandeau) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@codyreandeau"
---

@codyreandeau

# Cody Reandeau

@codyreandeau · Joined May 2023

## Comments

[Here are some examples that should help with point 7 and 8. Example 1: my\_pkg.my\_function executes for every row due to no scalar subquery: select e.empno, my\_pkg.my\_function(p\_param => 'Y') as results from emp e; Example 2: my\_pkg.my\_function called from a scalar subquery caches the result of the function; does not execute on every row: select e.empno, (select my\_pkg.my\_function(p\_param => 'Y') from dual) as results from emp e; Example 3: There isn't really a benefit in this instance because empno is different for every row, however it's still a good habit: select e.empno, (select my\_pkg.my\_function2(p\_param => e.empno) from dual) as results from emp e; Hope that helps! :)](https://hashnode.com/posts/writing-fast-queries/6425b63b73f171e0905c8d3a/comment/64308a8119dd2f34ad7fd34c#reply-64512ecc7a00e1d8014fd30e)

Reply · Article · May 2, 2023 · [Writing fast queries](https://hashnode.com/posts/writing-fast-queries/6425b63b73f171e0905c8d3a)
