skip to Main Content

Finding all subqueries in sql using regex – Mysql

Following regex (s*select([^()]*)) giving all subqueries but it ignores when subquery contains any sql functions like max(), count(), ....etc regex works for below SELECT student.name, teacher.name, sub.subject_name FROM student student JOIN teacher teacher on teacher.id=student.teacher_id JOIN (select subject.name subject_name, subject.id…

VIEW QUESTION

convert String to json object with wrong string

I have String like "[{'techid':'0128','daPoints':3,'speedingPoints':3,'fleetInspectionPoints':3,'lofPoints':3,'missedTrgModules':null,'fullName':'MANPREET SINGH','safetyInspectPoints':3,'missedTrgPoints':3,'speeding_qty':null,'safetyTotalPoints':21,'atFaultPoints':3,'atFaultAccident':null,'region':'PYEM','supervisor':'AGHATOR OSA','driverAlert':null,'status':'A'}]" need to convert into Json format trying something like this const text = "[{'techid':'0128','daPoints':3,'speedingPoints':3,'fleetInspectionPoints':3,'lofPoints':3,'missedTrgModules':null,'fullName':'MANPREET SINGH','safetyInspectPoints':3,'missedTrgPoints':3,'speeding_qty':null,'safetyTotalPoints':21,'atFaultPoints':3,'atFaultAccident':null,'region':'PYEM','supervisor':'AGHATOR OSA','driverAlert':null,'status':'A'}]"; const myArr = JSON.parse(text); document.getElementById("demo").innerHTML = myArr[0]; But getting error :- Uncaught SyntaxError: Expected property name or…

VIEW QUESTION
Back To Top
Search