What?
A quick note on how I got round one this one.

Why?
Often enough, our requirement is that the latest record from another table is associated with the current row, and often enough we get the latest by ordering the dataset of the subquery. In T-SQL and MySQL, this is not so much of an issue.

I get this error when having to use an ORDER BY clause in a subquery within an Oracle 11g environment.

How?
Consider the following:

SELECT
	ps.person_id,
	ps.person_name,
	(
	select 
		pa.person_reference as personid,
		pa.person_text as txt
	from 
		Person_Academia pa
	where 
		pa.type = 'USER' 
		AND pa.code = 'SPECIAL1'
		pa.person_reference = ps.person_reference
	order by
		pa.last_modified_date desc
	)
FROM
	Person_Staff ps

-- In oracle, yields "missing parenthesis" error.
So you can see my parentheses are fine.

Working Solution:
SELECT
	ps.person_id,
	ps.person_name,
	(
		select txt from
		(
			select 
				pa.person_text as txt, 
				pa.person_reference as personid,
				row_number() over (order by pa.last_modified_date desc) r
			from 
				Person_Academia pa
			where 
				pa.type = 'USER' 
				AND pa.code = 'SPECIAL1'
		)
	        where personid = ps.person_id

	) as AcademicInfo
FROM
	Person_Staff ps

Applies to:
- MS Windows 7 Enterprise


What?
So I can ping the server the Oracle 11g database sits on. I've installed the Oracle 11g client tools and can connect using sqlplus. But if I tnsping any oracle database, I get something along the lines of:

Message 3511 not found; No message file for product=NETWORK, facility=TNSMessage
3512 not found; No message file for product=NETWORK, facility=TNSMessage 3513 n
ot found; No message file for product=NETWORK, facility=TNSMessage 3509 not foun
d; No message file for product=NETWORK, facility=TNS

Why?
We NEED several instances of Oracle installed as we have different products/services and these run off various instances of Oracle 9i, 10g, and 11g. This article was written for those that need to support these kind of systems and not as an invite for suggestions on how my business should be run.


How?
So there are a variety of solutions that will fix this. However we have certain restrictions in my work environment thanks partly to group policies:

What?
This article describes a function that will return random data based on a given value. The function intends to determine the data type and return data that is absolutely irrelevant to the original data but the same length and the same type of data.

Why?
The joy of working with the plethora of applications out there result in me using MySQL, Oracle PL/SQL and Transact SQL in my day job. The equivalent functions have to be written up all in the name of "seamless integration"...

How?

What?
How to use the randomization features of Oracle PL/SQL.

Why?
I've been tasked with writing a stored procedure that scrambles data for developers working with some of our databases containing sensitive data.

How?

     SELECT DBMS_RANDOM.option1[(option2)] FROM DUAL;