<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
db api has support only for AND in WHERE for the db_query member.
You can print your own query and ship it to the API via
db_raw_query() (this will work of course only for SQL databases).<br>
<br>
Alternatives,<br>
- do two queries (probably not that optimal)<br>
- detect which value to use (from/to header) based on direction,
which can be detected using rr module.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<div class="moz-cite-prefix">On 12/6/12 11:08 AM, Hemanshu Patel
wrote:<br>
</div>
<blockquote
cite="mid:2063887501.92184.1354788531803.JavaMail.root@saicare.com"
type="cite">
<div style="font-family: times new roman, new york, times, serif;
font-size: 12pt; color: #000000">
<div>Dear friends,</div>
<div><br>
</div>
<div>I have to select entries from table which has a phone
nomber in to or from column in a table.</div>
<div><br>
</div>
<div>Say a dialog tables and phone number is 1000.</div>
<div>So i need to fetch all queries where to_uri or from_uri is
like 1000.</div>
<div>I have checked the code, but i didnt find any way to do
this OR behaviour.</div>
<div>Like in following simple example</div>
<div><br>
</div>
<div>
<p>db_keys[0] = &str_expires_col;<br>
db_ops[0] = OP_LT;<br>
db_vals[0].type = DB1_INT;<br>
db_vals[0].nul = 0;<br>
db_vals[0].val.int_val = (int)time(NULL);</p>
<p>result_cols[user_col= n_result_cols++] =
&str_username_col;<br>
result_cols[domain_col=n_result_cols++] =
&str_domain_col;<br>
result_cols[etag_col=n_result_cols++] = &str_etag_col;<br>
result_cols[event_col=n_result_cols++] = &str_event_col;</p>
<p><br>
</p>
<p>This can be used where expires coloumn is less then current
unix time. But say i want to change the query like expire
value is less then xxxxxx but greater then yyyyy Then how
can i do that?</p>
<p>Should i need to use another db_key with OP_GT value?</p>
<p>What is Operation info we should use for LIKE. I mean i
need to select value which is <a class="moz-txt-link-freetext" href="sip:1000@xx.xx.xx.xx">sip:1000@xx.xx.xx.xx</a> via
searching for 1000.</p>
<p><br>
</p>
<p>I Hope i had explain the question well. Please let me know
in case any confusion in question.</p>
</div>
<div><br>
</div>
<div><span name="x"></span>
<div><b><span><br>
--<br>
Regards,<br>
<div><br>
</div>
Hemanshu Patel<br>
<span color="#3366ff" style="color: #3366ff;"
data-mce-style="color: #3366ff;">----------------------------------------------------------------------<br>
</span></span></b>
<div>
<div><span style="color: rgb(0, 128, 0); "><strong>P</strong>Help
the environment – please don't print this email unless
you really need to!</span></div>
</div>
</div>
<span name="x"></span></div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
</body>
</html>