Upsert in Oracle SQL using Merge
Here is a handy bit of SQL for Oracle to allow you to do an Upsert on a row. MERGE INTO UserDetails DEST USING(SELECT 1 AS ID FROM DUAL) src ON (DEST.userid = 'john.smith') WHEN MATCHED THEN UPDATE SET...
View ArticleOracle Trigger: Stop field being updated
So an unusual requirement popped up recently. A 3rd party data update was being applied to one of our data tables which was causing issues. Basically, despite the fact we needed the data sometimes an...
View ArticleOracle : Find Text in Stored Procedure/Functions
If you’re anything like me you work in an environment with a lot of legacy applications doing the rounds. Here these applications are in Oracle so while our later work is built on Entity Framework...
View ArticleOracle Savepoint
It’s inevitable that sometimes sql scripts and stored procs can run away with themselves and get quiet complicated. A really handy feature to Rollback a script to a certain point if there’s been a...
View ArticleOracle PL/SQL Date Manipulation
Some handy date manipulation functions available for dates in PL/SQL Convert String to date select to_date('21-01-2014','dd-mm-yy') from dual; Convert time on date to midnight i.e. (01-01-2014 16:30...
View ArticleOracle: Update based on join
Sometimes an update or group update needs to be performed where a join on another table is required to return the correct dataset to update. In this instance the code below will make it easier to...
View Article
More Pages to Explore .....