As detailed in this question, it's not possible to create OUT parameters with size restrictions in Oracle 10g. Has this situation improved with 11g?
Here's my real-world problem with this:
Oracle PL/SQL versions of INET6_ATON and NTOA functions?
You're welcome :) However, the one thing I do not like about these functions is the lack of a RETURN CHAR(32)
forces any function-based index (FBI) to use the maximum VARCHAR2 size of 4000 for the entire index (which would usually error out because of index field size restrictions), unless you encapsulate the entire thing in a SUBSTR, forcing a fixed size. This is ugly to use in a typical SQL statement as you now have to make sure everybody is not only using the functions, but also using the SUBSTR encapsulation, so that the index is used properly.
Would virtual columns solve this problem? As in, you define virtual columns for each IP, like srcip_iptohex
, srcip_nettohex_start
, srcip_nettohex_end
, and then put the CHAR(32) restriction on the virtual columns. Or do virtual columns even support PL/SQL calls? Since the virtual columns don't actually get stored, you would still need to index the columns to make sure they are useful.