- 论坛徽章:
- 1
|
文件格式类似如下,有几百行
if ($compid == "") $compid = $sessionMgr->getValue("CompId");
$secrole = $sessionMgr->getValue("usecrole");
$cntid = $sessionMgr->getValue("ucntid");
$strError = "";
$recSetROLES = null;
$recSet= null;
$recSetSOWO= null;
$recSetLocations= null;
$dbConn = GetDBConnection();
$strSQL = "SELECT cust_id, cust_code, cust_name, it_name, TO_CHAR(cust_start_date, '" . $tz_date_format . "') cust_start_date, ";
$strSQL .= "TO_CHAR(cust_end_date, '" . $tz_date_format . "') cust_end_date, cust_logo_url, cust_homepage_url, ";
$strSQL .= "cust_tz_id, tz_code || ' - ' || tz_name tz_name, servc.comp_code comp_code_serviced_by, soldc.comp_code comp_code_sold_b
y, ";
$strSQL .= "cust_stats_enable_5min, cust_stats_site, cust_proactive_monthday, ";
$strSQL .= "TO_CHAR(cust_monitor_start_date, '" . $tz_date_format . "') cust_monitor_start_date, ";
$strSQL .= "TO_CHAR(cust_monitor_end_date, '" . $tz_date_format . "') cust_monitor_end_date, ";
$strSQL .= "cust_dns_domain, NVL(servc.comp_name,'') comp_name_serviced_by, soldc.comp_name comp_name_sold_by, ";
$strSQL .= "comp.comp_address1, comp.comp_address2, comp.comp_address3, comp.comp_address4, comp.comp_city, comp.comp_state, ";
$strSQL .= "comp.comp_zip, comp.comp_country, comp.comp_partner, sl_level_name, ";
$strSQL .= "cntc.cnt_first_name || ' ' || cntc.cnt_last_name cnt_created, TO_CHAR(comp.comp_created_date, '" . $tz_full_date_format
. "') comp_created_date, ";
$strSQL .= "cntu.cnt_first_name || ' ' || cntu.cnt_last_name cnt_updated, TO_CHAR(comp.comp_updated_date, '" . $tz_full_date_format
. "') comp_updated_date, ";
$strSQL .= "DECODE(cust_proactive_weekday, 'sun', 'Sunday', 'mon', 'Monday', 'tue', 'Tuesday', 'wed', 'Wednesday', 'thu', 'Thursday'
, 'fri', 'Friday', 'sat', 'Saturday', 'None') cust_proactive_weekday, ";
$strSQL .= "DECODE(cust_proactive_biweekday, 'sun', 'Sunday', 'mon', 'Monday', 'tue', 'Tuesday', 'wed', 'Wednesday', 'thu', 'Thursda
y', 'fri', 'Friday', 'sat', 'Saturday', 'None') cust_proactive_biweekday ";
$strSQL .= "FROM ctradm.customers, sv_time_zones, sv_companies servc, sv_companies soldc, sv_companies comp, sv_industry_types, ";
$strSQL .= "sv_service_levels, sv_contacts cntc, sv_contacts cntu ";
$strSQL .= "WHERE cust_tz_id = tz_id AND cust_id = comp.comp_id AND cust_cust_id_serviced_by = servc.comp_id (+) ";
$strSQL .= "AND cust_cust_id_sold_by = soldc.comp_id (+) AND comp.comp_it_id = it_id (+) AND sl_id(+) = cust_service_level ";
$strSQL .= "AND cntc.cnt_id = comp.comp_cnt_id_created AND cntu.cnt_id = comp.comp_cnt_id_updated AND cust_id = $compid ";
.............................
现在我只希望将类似于以下的语句变为
$strSQL = "SELECT cust_id, cust_code, cust_name, it_name, TO_CHAR(cust_start_date, '" . $tz_date_format . "') cust_start_date, ";
SELECT cust_id, cust_code, cust_name, it_name, TO_CHAR(cust_start_date, '" . $tz_date_format . "') cust_start_date,
也就是要将$strSQL 开头的所有行找出来,然后再取$strSQL = "和 "; 之间的内容
请问各位高手如何写
[ 本帖最后由 yuantong 于 2008-3-13 21:27 编辑 ] |
|