Tuesday, May 13, 2008

Bind Parameters in a complex query

Oracle Data dictionary tip :

This is pretty useful when you are running a huge pl/sql code or a complex query and you need to know what bind parameters are being used for a query. helps figure out the iteration you are in amongst many other.




select name, position, datatype,
value_string, value_anydata
from V$SQL_BIND_CAPTURE where sql_id
IN
( select a.sql_id
from v$sql a where sql_id in
( select sql_id
from v$session
where osuser = 'ssinghal'
and machine = 'my_machine_name
and status = 'ACTIVE'
)
);

Tuesday, May 6, 2008

Search Replace in all Vim Buffers


:bufdo %s/pattern/substitution/ge | update



bufdo – apply the following command to all buffers – see :help :bufdo.

%s – search and replace the whole file

g – change all instances in a line

e – avoid an error when the pattern doesn’t exist in a buffer

update – write the file only if changes were made

source : http://vim.wikia.com/wiki/Search_and_replace_in_all_buffers