Autoformatting MySQL views

Answered

Hi guys, is there any way to:

1. Remove Parentheses

2. Wrap the "JOIN"

ie: instead of:

"(((((((((((TRANSPORTREQUEST tr JOIN TRANSPORTREQUESTSHIPMENTS trs ON ((trs.TRANSPORTREQUESTID = tr.TRANSPORTREQUESTID))) JOIN SHIPMENT sh ON ((sh.SHIPMENTID = trs.SHIPMENTID))) JOIN SERVICEREQUEST sr ON ((sh.SERVICEREQUESTID = sr.SERVICEREQUESTID))) JOIN STATUSNAME trsn ON ((trsn.STATUSNAMEID = tr.PHYSICALSTATUSNAMEID))) JOIN SITE os ON ((os.SITEID = sr.ORIGINID))) JOIN SITE ds ON ((ds.SITEID = sr.DESTINATIONID))) JOIN MAPPOINT dmp ON ((dmp.MPID = ds.MPID))) JOIN AREA da ON ((da.AREAID = dmp.AREAID))) JOIN AREAGROUPDETAIL dagd ON ((dagd.AREAID = da.AREAID))) JOIN AREAGROUP dag ON ((dag.AGID = dagd.AGID)))
JOIN voucherAgg ON ((voucherAgg.TRANSPORTREQUESTID = tr.TRANSPORTREQUESTID)))"

I'd like:

"TRANSPORTREQUEST tr
JOIN TRANSPORTREQUESTSHIPMENTS trs ON trs.TRANSPORTREQUESTID = tr.TRANSPORTREQUESTID
JOIN SHIPMENT sh ON sh.SHIPMENTID = trs.SHIPMENTID
JOIN SERVICEREQUEST sr ON sh.SERVICEREQUESTID = sr.SERVICEREQUESTID
JOIN STATUSNAME trsn ON trsn.STATUSNAMEID = tr.PHYSICALSTATUSNAMEID
JOIN SITE os ON os.SITEID = sr.ORIGINID
JOIN SITE ds ON ds.SITEID = sr.DESTINATIONID
JOIN MAPPOINT dmp ON dmp.MPID = ds.MPID
JOIN AREA da ON da.AREAID = dmp.AREAID
JOIN AREAGROUPDETAIL dagd ON dagd.AREAID = da.AREAID
JOIN AREAGROUP dag ON dag.AGID = dagd.AGID
JOIN voucherAgg ON voucherAgg.TRANSPORTREQUESTID = tr.TRANSPORTREQUESTID"
2 comments
Comment actions Permalink

sorry about the weird formatting of the post itself (my first)

0
Comment actions Permalink

radrichard,

Do you get this formatting via SQL Code Generator or when you double-click for a specified view?

 

0

Please sign in to leave a comment.