Friday, 7 January 2011

PL/sql function and no_data_found

PL/SQL functions with a 'select col1 into v1 from table' line in them behave differently when they hit a no_data_found error (i.e. if the table is empty).
IF
you call the function like this .....
BEGIN
my_function;
END;
THEN
YOU get a no_data_found exception raised.


BUT
IF YOU CALL THE FUNCTION LIKE THIS....
SELECT my_function FROM dual;
THEN
It will not raise a no_data_found

see
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:317260900346187160

Monday, 8 November 2010

db link full spec

DROP DATABASE LINK "apollo";
CREATE DATABASE LINK "apollo"
connect TO xxxxxx
IDENTIFIED BY "xxxxxxx"
using '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS=(PROTOCOL=tcp)(HOST=10.24.0.11)(PORT=1521)))(connect_data=(SID=MIS10G1)))';
SELECT * FROM dual@apollo

Thursday, 28 October 2010

Wednesday, 27 October 2010

direct connection

sqlplus user/pass@10.0.0.1:1521/service_name

Monday, 25 October 2010

tnsping direct

the sytax

tnsping '(ADDRESS=(PROTOCOL=tcp)(HOST=10.24.0.11)(PORT=1521))'

Tuesday, 19 October 2010

authid current_user

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/subprograms.htm#i18574

To give the package the same rights as the caller of the package.