[SR-Users] How to use LIMIT 1 in db_query api
Daniel-Constantin Mierla
miconda at gmail.com
Mon Dec 10 10:40:22 CET 2012
Hello,
On 12/8/12 6:53 PM, Krishna Kurapati wrote:
> Hi,
>
> I need a way to limit the results to just one row. The only way I know
> I could do is to call db_query followed by fetch_result of 1 row.
> However this is not optimal as all the rows are fetched to dynamic
> memory with db_query.
>
> Is there an alternative approach?
you can't set limit in the query() function of the DB API -- this is an
abstract layer that is not only for SQL server, working also for
berkeley db or text files. You can use raw_query(), building your own
sql statement as you like.
Cheers,
Daniel
>
> Thanks
>
> Krish Kura
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20121210/96f4c46f/attachment.htm>
More information about the sr-users
mailing list