Created
February 3, 2015 14:53
-
-
Save xtender/e9aa5219b0a4266017e5 to your computer and use it in GitHub Desktop.
call_vs_exec.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set feed on timing on echo on; | |
| spool &_SPOOLS./call_vs_exec_spool.sql | |
| create or replace procedure xt_proc(n in int, o out number) as | |
| dummy number:=0; | |
| begin | |
| for i in 1..n loop | |
| for j in 1..n loop | |
| dummy:=dummy+ln(i+j); | |
| end loop; | |
| end loop; | |
| o:=dummy; | |
| end; | |
| / | |
| var o number; | |
| -- parsing: | |
| call xt_proc(1,:o); | |
| print o; | |
| exec xt_proc(1,:o); | |
| print o; | |
| -- test: | |
| call xt_proc(100,:o); | |
| print o; | |
| exec xt_proc(100,:o); | |
| print o; | |
| col sql_text for a30 | |
| select | |
| sql_text | |
| ,s.COMMAND_TYPE | |
| ,s.SHARABLE_MEM | |
| ,s.PERSISTENT_MEM | |
| ,s.RUNTIME_MEM | |
| ,s.executions | |
| ,s.END_OF_FETCH_COUNT | |
| ,s.ELAPSED_TIME | |
| ,s.ROWS_PROCESSED | |
| from v$sql s | |
| where upper(s.sql_text) like '%XT_PROC(100%' | |
| and lower(s.sql_text) not like '%v$sql%' | |
| / | |
| spool off; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment