User (Balasubramanya@kshema.com) posted:
When I was trying to execute a longer query using db_execute_query
function, it was giving an error "the sql string is too long" Is there
any alternate solution? The quiery is
te,t2.wpa_status,t3.rc_date,t3.rc_status,t4.pr_dat e,t4.pr_status from
proj_detail t1,work_prod_audit t2,release_committe t3,phase_review t4
where t1.project_code = 'DO' and t1.project_code =t2.project_code and
t1.project_code =t3.project_code and t1.project_code =t4.project_code
and t1.phase_no = t2.phase_no and t1.phase_no =t3.phase_no and
t1.phase_no = t4.phase_no order by t1.phase_no" , record_no);
Thanks in advance
Re: Database checking
User (email@example.com) posted:
With long SQL strings like this I find it easier to break the string up into
smaller chunks and then concatenating them together. For example with your
example I would probably do the following :
QueryPt1 = "select t1.phase_no,......"
QueryPt2 = "from proj_detail t1,........"
QueryPt3 = "where t1.project_code = 'DO',........"
QueryPt4 = "order by t1.phase_no" ,......"
db_execute_query("query1", QueryPt1 & QueryPt2 & QueryPt3 & QueryPt4,);