I have written a batch script that give an error. The batch generates an SQL code and the code fails with the error
ERROR: invalid regular expression: parentheses () not balanced
The code is as below
dump (SELECT concat(p.ORDER_NO,'_K',b.MAT_ID,'_D',round(b.rect_width,0),'_R',round(b.rect_height,0),'_N','_L',p.BATCH_NO)FROM masch_sets, order_item_part p, order_item_workstep w, order_item_buildup b,auf_pos_texte t WHERE w.READY_MACHINE = MS_NR AND w.PLAN_SEQ > 0 AND w.PROD_STATUS >= 30 AND w.PROD_STATUS <= 70 AND w.PROD_STATUS != 50 AND p.BATCH_NO > 0 AND p.ORDER_NO = w.ORDER_NO AND p.ITEM_NO = w.ITEM_NO AND p.BUILD_SEQ = w.BUILD_SEQ AND p.PART_CNT = w.PART_CNT AND p.HISTORY = w.HISTORY AND p.ORDER_NO = b.ORDER_NO AND p.ITEM_NO = b.ITEM_NO AND p.BUILD_SEQ = b.BUILD_SEQ AND (w.READY_DATE BETWEEN TO_TIMESTAMP('2023/01/01','YYYY/MM/DD')::timestamp without time zone AND TO_TIMESTAMP('2024/12/12','YYYY/MM/DD')::timestamp without time zone + 0.99999) AND w.READY_MACHINE IN ( SELECT DISTINCT PMP_MACHINE_NO FROM prod_mon_plant WHERE PMP_PLANT_NO = 2 AND PMP_GROUP_NO = 1 ) AND p.BATCH_SEQ > 0 and t.pt_order_no=p.ORDER_NO and t.pt_order_pos=p.ITEM_NO and t.pt_text_nr=40 ORDER BY w.STEP_NO, p.BATCH_NO, p.BATCH_SEQ) ;
I was expecting the SQL to run.
Executed the code in Command Prompt -> SQL
Nigel Coutinho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1