Author: Sriram Sanka
-
-
Not null constraint :–ORA-00932: inconsistent datatypes: expected NUMBER got LONG
SQL> sho user USER is “SCOTT” SQL> select constraint_name from user_constraints 2 where search_condition not like ‘%NOT NULL’; where search_condition not like ‘%NOT NULL’ * ERROR at line 2: ORA-00932: inconsistent datatypes: expected NUMBER got LONG SQL> create or replace function get_search_condition(p_cons_name in varchar2 ) return varchar2 2 authid current_user 3 is 4 l_search_condition user_constraints.search_condition%type;…
-
Reverse function in oracle
SQL> select reverse(‘sriram oracle DBA’) from dual; REVERSE(‘SRIRAMOR —————– ABD elcaro marirs As this reverse funcction is undocumented we can achive the same using a procedure…….. SQL> create or replace procedure rev(x in varchar2) as 2 c char(1); 3 i number; 4 begin 5 for i in 1..length(x) loop 6 select substr(x,length(x)-i+1,1) into c from…
-
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
SQL> conn raghu/raghu Connected. SQL> set autotrace on SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled SP2-0611: Error enabling STATISTICS report SQL> conn / as sysdba Connected. SQL> grant plustrace to raghu; grant plustrace to raghu * ERROR at line 1: ORA-01919: role ‘PLUSTRACE’ does not exist. SQL> @ %oracle_home%\sqlplus\admin\plustrce.sql; SQL> SQL>…
