Archive

Posts Tagged ‘oracle sql’

Split string in sql query – oracle

October 3, 2016 Leave a comment

select regexp_substr('MyString,otherString,lastOneStr','[^,]+', 1, level) from dual
connect by regexp_substr('MyString,otherString,lastOneStr', '[^,]+', 1, level) is not null;

–Result :
———-
–MyString
–otherString
–lastOneStr

Advertisements
Categories: Beyond, Mini-tips, Oracle, SQL

Split string in oracle sql query

August 1, 2016 Leave a comment

select regexp_substr('MyString,otherString,lastOneStr','[^,]+', 1, 2) from dual; 
-- Returns 'otherString' String
Categories: Beyond, Mini-tips, Oracle, plsql, SQL, Tips

Simple grant/revoke select on view Oracle DB

May 17, 2016 Leave a comment

grant select on my_schema.my_new_view to schema_that_will_see_it;
commit;

revoke select on my_schema.my_new_view from schema_that_will_see_it;
commit;

Query to know what changed in your database objects

January 18, 2016 Leave a comment

select last_ddl_time, object_name, object_type
from dba_objects
where last_ddl_time is not null
order by 1 desc;