Category Archives: sql
How to encode accents in an ascii sql file
Sometimes when you want to send a sql file to someone and it contains accents things go … bad. To circumvent this in oracle sql files you can escape these with compose(unistr(‘CHARACTER + ACCENT’)). This way your sql file remains … Continue reading
Posted in sql, Uncategorized
Comments Off on How to encode accents in an ascii sql file
Selecting a random employee with adjacency tables
In my previous blogpost I mentioned a way to retrieve the entire tree from a hierarchy stored with adjacency tables. Now I’ve got a way to retrieve a random employee in an organisation. I use ORDER BY NEWID() to randomize … Continue reading
Adjacency tables
I’m well aware that adjacency tables aren’t the newest way of storing hierarchies in a database. Personally I prefer to use nested sets. But on this one project I had to work with a legacy database. It took me quite … Continue reading
Posted in sql
Comments Off on Adjacency tables