// input query
QString query
= "select distinct(a.CALLING_NUMBER),b.cdr_details,a.CALLING _IMSI,a.CALLING_IMEI,a.CALLED_IMSI,a.CALLED_NUMBER ,a.CALLED_IMEI,a.CALLED_NUMBER_TON,a.LOC_AREA_CODE ,a.CELL_ID,a.MSC_ID,convert(varchar,start_time,105 ) +' '+ convert(varchar,start_time,108),a.DURATION,a.MSRN, LATITUDE,LONGITUDE,LOC_DETAIL from tbl_cdr_loader a,tbl_cdr_type_detail b,tbl_location_detail c where a.cdr_type=b.cdr_type and a.loc_area_code=c.loc_code and a.cell_id=c.cell_id and a.calling_number in ('<>','<>','<>','<>','<>')" ;
// input numbers
QString inputNumbers
= "9831024841|9831024844|9831024843|9831024842|9831024846" ;
// split this string to retrieve actual numbers
// iterate on query and replace "on the fly"
foreach
(const QString & number, numbers
){
// find first occurence of brackets in query
int index = query.indexOf("<>") ;
if(index>=0)
{
// replace two characters ("<>") by the corresponding number
query.replace(index,2,number) ;
}
}
// input query
QString query = "select distinct(a.CALLING_NUMBER),b.cdr_details,a.CALLING _IMSI,a.CALLING_IMEI,a.CALLED_IMSI,a.CALLED_NUMBER ,a.CALLED_IMEI,a.CALLED_NUMBER_TON,a.LOC_AREA_CODE ,a.CELL_ID,a.MSC_ID,convert(varchar,start_time,105 ) +' '+ convert(varchar,start_time,108),a.DURATION,a.MSRN, LATITUDE,LONGITUDE,LOC_DETAIL from tbl_cdr_loader a,tbl_cdr_type_detail b,tbl_location_detail c where a.cdr_type=b.cdr_type and a.loc_area_code=c.loc_code and a.cell_id=c.cell_id and a.calling_number in ('<>','<>','<>','<>','<>')" ;
// input numbers
QString inputNumbers = "9831024841|9831024844|9831024843|9831024842|9831024846" ;
// split this string to retrieve actual numbers
QStringList numbers = inputNumbers.split("|", QString::SkipEmptyParts) ;
// iterate on query and replace "on the fly"
foreach(const QString & number, numbers)
{
// find first occurence of brackets in query
int index = query.indexOf("<>") ;
if(index>=0)
{
// replace two characters ("<>") by the corresponding number
query.replace(index,2,number) ;
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks