parameter

Oracle: eval function

Wednesday, January 14th, 2009

create or replace function eval (expr varchar2) return varchar2
as
ret varchar2(4000);
begin
execute immediate ‘begin :result := ‘ || expr || ‘; end;’ using out ret;
return ret;
end;
/

The discussion and examples could be found there

Using pattern lists in Unix

Monday, February 20th, 2006

Here is the small reminder about the syntax of the “case” command and the usage of the pattern lists.

#!/bin/ksh
print -n “Please enter the line: ”
read line
case “$line” in
?(dog|cat) ) print “zero or one occurrence of any pattern” ;;
*(low|high) ) print “zero or more occurrences of any pattern” ;;
@(duncan|methos) ) print “exactly [...]

Parsing script parameters

Thursday, February 2nd, 2006

Quick and dirty parsing procedure for unix shell scripts

parse_command_line ()
{
typeset -i user_opt help_opt password_opt verbose_opt
typeset errmsg
arg_cou=$#
while [ "$#" -gt 0 ]
do
case “$1″ in
-@([U]) ) let user_opt=user_opt+1 ;;
-P ) let password_opt=password_opt+1 ; ask_pass=0 ;;
-option1 ) ;;
-option2 ) [...]

Show hidden parameters in Oracle

Thursday, February 2nd, 2006

For all these hidden underscore parameters…
Just press ENTER to see them all.

col “Parameter” for a50
col “Session Value” for a15
col “Instance Value” for a15
select a.ksppinm “Parameter”, b.ksppstvl “Session Value”, c.ksppstvl “Instance Value”
from x$ksppi a, x$ksppcv b, x$ksppsv c
where a.indx = b.indx and a.indx = c.indx
and substr(ksppinm,1,1)=’_’
and a.ksppinm like ‘%&param.%’
order by a.ksppinm;

Setting the parameter:

alter system set “&param.” [...]