Take a look at this thread: [url]http://www.open-audit.org/phpBB3/viewtopic.php?f=5&t=2188&hilit=[/url]
I created a stored procedure: [code]DELIMITER $$
DROP PROCEDURE IF EXISTS `PatchStatus`$$ CREATE PROCEDURE `PatchStatus`(IN inVar VARCHAR(100)) BEGIN
SELECT * FROM ( SELECT system_name, 'Installed' as inVar FROM software, system WHERE software_name LIKE CONCAT('%',inVar,'%') AND software_uuid = system_uuid
UNION
SELECT DISTINCT system_name, 'Not Installed' AS software_name FROM system WHERE system_name NOT IN (SELECT DISTINCT system_name FROM software, system WHERE software_name LIKE CONCAT('%',inVar,'%') AND software_uuid = system_uuid) ) AS U ORDER BY system_name; END $$
DELIMITER ; [/code]
which can then be used like so: [code]Call PatchStatus('KB123456')[/code]
_________________ Cheers, Nick.
[size=85]OA Server: Windows Server 2003 / Apache 2 Auditing: 1600 Workstations, 200 Servers OS's: Windows XP / Windows 2000 / Windows 2003 Server / Windows Vista LDAP: Active Directory[/size]
|