<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18904">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>I'm experimenting with mod_lcr with postgresql
(8.4.4)</FONT></DIV>
<DIV><FONT size=2>there s an example of custom sql on wiki below :</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><PRE> <profile name="use_prefix">
<param name="custom_sql" value="
SELECT l.digits, c.carrier_name, l.${lcr_rate_field}, cg.prefix AS gw_prefix, cg.suffix AS gw_suffix,
l.lead_strip, l.trail_strip, l.prefix, l.suffix, cg.codec, l.cid
FROM lcr l
JOIN carriers c ON l.carrier_id=c.id
JOIN carrier_gateway cg ON c.id=cg.carrier_id
WHERE c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1'
AND digits_prefix @> '%q'
AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end
ORDER BY digits DESC, ${lcr_rate_field} asc, random();
"/>
</profile>
</PRE><PRE><FONT face=Arial>however the query failed cause of digits_prefix field doesn't exist in the table.</FONT></PRE><PRE><FONT face=Arial>is it a typo ? or does it need a field concatenation of prefix and digits ?</FONT></PRE><PRE><FONT face=Arial>Thanks</FONT></PRE><PRE><FONT face=Arial></FONT> </PRE><PRE><FONT face=Arial>Franck</FONT></PRE></DIV></BODY></HTML>