Norman , <br><br>Avp_db_query also perform the PL/SQL function and Procedure , <br>This will support only , MySql version must be grater than 5.0 , <br><br>But if the avp_db_query is in condition statement is should the Error, Query will execute it,
<br>don't worry at Error, <br><br>avp_db_query execute also all SQL statements , it can any any table , that depends on the users to access the DB in MySQL user .<br><br>I tested this things, <br><br><div><span class="gmail_quote">
On 4/11/07, <b class="gmail_sendername">Norman Brandinger</b> <<a href="mailto:norm@goes.com">norm@goes.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Chungyu,<br><br>Perhaps the following will work for you:<br><br>avp_db_query("DELETE FROM usr_preferences WHERE (username = 'bob') AND<br>(number = '1')");<br><br>Using the above as an example, you should be able to INSERT into a table
<br>with avp_db_query();<br><br>Regards,<br>Norm<br><br>chungyu wrote:<br>> Dear all:<br>> Avpops module' exported function avp_db_delete() can do delete one record?<br>> example:<br>> I use "test" as default table that has two fields.
<br>> username | number<br>> -------------------<br>> bob | 1<br>> alice | 1<br>> bob | 2<br>> my configuration:<br>> modparam("avpops", "avp_url", "mysql://ser:heslo@localhost
/ser")<br>> modparam("avpops", "avp_table", "test")<br>> modparam("avpops", "username_column", "username")<br>> modparam("avpops", "avp_aliases", "num=i:55")
<br>> modparam("avpops", "db_scheme",<br>> "number_scheme:table=test;value_col=number;value_type=string")<br>> if (method=="INVITE"){<br>> avp_db_load("$from/username", "$num/$number_scheme"); //load from
<br>> table "test" ,number column as string value into AVP name '$num'<br>> avp_db_delete("$from/username", "s:test") //delete all bob' record<br>> };<br>> if bob calling then bob'record has deleted
<br>> username | number<br>> --------------------<br>> alice | 1<br>> But i want delete a record.<br>> ex: delete number value is 1 for bob<br>> username | number<br>> --------------------<br>> alice | 1
<br>> ---------------------<br>> bob | 2<br>> avp_db_delete() can do delete one record?<br>> Another question is avp_db_store() can do insert new data in table?<br>> ex: insert into test (username,number) values ("mary","3")
<br>> username | number<br>> -------------------<br>> alice | 1<br>> -------------------<br>> bob | 2<br>> -------------------<br>> mary | 3<br>> avp_db_store() can do it?<br>> sorry,I still can't understand what it mean about avp_db_store() and
<br>> avp_db_delete().<br>> Can tell me?<br>> Thanks a lot in advance<br>> Chungyu<br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________
<br>> Users mailing list<br>> <a href="mailto:Users@openser.org">Users@openser.org</a><br>> <a href="http://openser.org/cgi-bin/mailman/listinfo/users">http://openser.org/cgi-bin/mailman/listinfo/users</a><br>>
<br><br><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openser.org">Users@openser.org</a><br><a href="http://openser.org/cgi-bin/mailman/listinfo/users">http://openser.org/cgi-bin/mailman/listinfo/users
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Thanks and Regards<br>Ravi Prakash Sunkara                <br><a href="mailto:ravi.sunkara@hyperion-tech.com">ravi.sunkara@hyperion-tech.com</a>         <br>M:+91 9985077535<br><a href="http://www.hyperion-tech.com">
www.hyperion-tech.com</a><br>Client and Parent company :- <a href="http://www.august-networks.com">www.august-networks.com</a>