I have a SQL string:
var sql= "AND DT_FIM IS NULL AND ( CD_JOB, DT_INI_JOB ) IN (SELECT x.CD_JOB, x.DT_INI FROM PRS_JOBS_MAQUINA x WHERE x.CD_JOB = ':CD_JOB' AND TO_CHAR(x.DT_INI, 'YYYY-MM-DD') = ':DT_INI_JOB' AND x.DT_FIM IS NULL)
and i need to extract the binded values(:CD_JOB , :DT_INI_JOB), the problem is that with
var bindFields=sql.substring(sql.lastIndexOf("':") + 1 , sql.lastIndexOf("'"));
it returns only the first match and i need both. Is it possible with Javascript? Lodash to the rescue if anybody find it useful.
https://jsfiddle.net/oq0dmyjo/1/ . Apreciate your help . Thanks