I did some tracing. In both cases, the trace file shows the following call:
PARSING IN CURSOR #197688992 len=347 dep=1 uid=110 oct=47 lid=110 tim=1199243599539 hv=2498191275 ad='7ff4a7f2558' sqlid='10xwr2yaffrxb'
declare
begin
:1 := "ASKTOM"."MYFNC_STATS".ODCIStatsTableFunction(sys.ODCIFuncInfo('ASKTOM', 'MYFNC', NULL, 1), :2, sys.ODCIARGDESCLIST(sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL), sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL)) , :3, :4);
exception
when others then
raise;
end;
END OF STMT
However if we combine that with a 10053 optimizer trace for both scenarios, we see an interesting difference
When using literalsSINGLE TABLE ACCESS PATH
Single Table Cardinality Estimation for KOKBF$0[KOKBF$0]
SPD: Return code in qosdDSDirSetup: NOCTX, estType = TABLE
Calling user-defined function card function...
Bind :3 Value '1,2,3,4'
Bind :4 Value ','
"ASKTOM"."MYFNC_STATS".ODCIStatsTableFunction returned:
num_rows : 4
When using bindsSINGLE TABLE ACCESS PATH
Single Table Cardinality Estimation for KOKBF$0[KOKBF$0]
SPD: Return code in qosdDSDirSetup: NOCTX, estType = TABLE
Calling user-defined function card function...
Bind :3 Value :1
Bind :4 Value ','
ORA-1008 received when calling ASKTOM.MYFNC_STATS.ODCIStatsTableFunction -- method ignored
So looks like an issue with *calling* the statistics function, and hence your user defined statistics dont make it through.