I sometimes use SQLInform to format large SQL scripts, but that may not be what you are after.
Galwegian
2009-07-17 11:25:21
I sometimes use SQLInform to format large SQL scripts, but that may not be what you are after.
Well, I'd write and indent it all somewhat differently, but whether it's "smarter" is up to you:
$sql = sprintf("
SELECT %s, %s, %s
FROM %s
LEFT OUTER JOIN OS USING (OS_ID)
JOIN OSSUBVERSION USING (OSSUBVERSION_ID)
JOIN OSMINORVERSION USING (OSMINORVERSION_ID)
JOIN OSMAJORVERSION USING (OSMAJORVERSION_ID)
LEFT OUTER JOIN PROCESSORMODEL USING (PROCESSORMODEL_ID)
JOIN PROCESSORMANUFACTURER USING (PROCESSORMANUFACTURER_ID)
WHERE %s = :id
AND MANDATOR_ID = :mandatorId
", $serverFields, $osFields, $processorFields, $this->_tableName, $this->_identifier);