I would strongly recommend to "talk" to PDM via its API: 2014 SOLIDWORKS API Help - SOLIDWORKS Enterprise PDM API Help . It is not suggested to read/write data directly from PDM SQL database.
Not sure what ERP system you are using, but if syncing the data together is of high importance, we offer an ERP solution with direct SOLIDWORKS integration. This would get your three databases down to two, and depending on how you utilize SOLIDWORKS electrical, that could also be integrated.
If you would like more information, feel free to contact me here, or directly via: