I don't see a direct mapping between the run status and defect ID, in the defects table there is a col called Run id which is the same as used in the Run table, may be you have to work with these to check if the Run Id of the failed test has an entry in the defects table.
PS: I am looking at the oTA guide for QC 8.2, it may have changed in 9.x
I confirm that "things have changed" : defects can now be linked to more than one object (be it a requirement, a test, a test set, a test instance, a run, an executed test step or another defect). Thus the ID's found in the BUG table are no more used. QC uses a new table called LINK.
You can access defects linked to a run (either directly or indirectly - because they are linked to a step of that run) through the BugLinkFactory property of the Run object. Refer to the OTA Reference.