Dear all: Avpops module' exported function avp_db_delete() can do delete one record?
example: I use "test" as default table that has two fields.
username | number ------------------- bob | 1 alice | 1 bob | 2
my configuration: modparam("avpops", "avp_url", "mysql://ser:heslo@localhost/ser") modparam("avpops", "avp_table", "test") modparam("avpops", "username_column", "username") modparam("avpops", "avp_aliases", "num=i:55") modparam("avpops", "db_scheme", "number_scheme:table=test;value_col=number;value_type=string")
if (method=="INVITE"){ avp_db_load("$from/username", "$num/$number_scheme"); //load from table "test" ,number column as string value into AVP name '$num' avp_db_delete("$from/username", "s:test") //delete all bob' record };
if bob calling then bob'record has deleted
username | number -------------------- alice | 1
But i want delete a record. ex: delete number value is 1 for bob
username | number -------------------- alice | 1 --------------------- bob | 2
avp_db_delete() can do delete one record?
Another question is avp_db_store() can do insert new data in table?
ex: insert into test (username,number) values ("mary","3")
username | number ------------------- alice | 1 ------------------- bob | 2 ------------------- mary | 3
avp_db_store() can do it?
sorry,I still can't understand what it mean about avp_db_store() and avp_db_delete(). Can tell me? Thanks a lot in advance
Chungyu
Chungyu,
Perhaps the following will work for you:
avp_db_query("DELETE FROM usr_preferences WHERE (username = 'bob') AND (number = '1')");
Using the above as an example, you should be able to INSERT into a table with avp_db_query();
Regards, Norm
chungyu wrote:
Dear all: Avpops module' exported function avp_db_delete() can do delete one record? example: I use "test" as default table that has two fields. username | number
bob | 1 alice | 1 bob | 2 my configuration: modparam("avpops", "avp_url", "mysql://ser:heslo@localhost/ser") modparam("avpops", "avp_table", "test") modparam("avpops", "username_column", "username") modparam("avpops", "avp_aliases", "num=i:55") modparam("avpops", "db_scheme", "number_scheme:table=test;value_col=number;value_type=string") if (method=="INVITE"){ avp_db_load("$from/username", "$num/$number_scheme"); //load from table "test" ,number column as string value into AVP name '$num' avp_db_delete("$from/username", "s:test") //delete all bob' record }; if bob calling then bob'record has deleted username | number
alice | 1 But i want delete a record. ex: delete number value is 1 for bob username | number
alice | 1
bob | 2 avp_db_delete() can do delete one record? Another question is avp_db_store() can do insert new data in table? ex: insert into test (username,number) values ("mary","3") username | number
alice | 1
bob | 2
mary | 3 avp_db_store() can do it? sorry,I still can't understand what it mean about avp_db_store() and avp_db_delete(). Can tell me? Thanks a lot in advance Chungyu
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Norman ,
Avp_db_query also perform the PL/SQL function and Procedure , This will support only , MySql version must be grater than 5.0 ,
But if the avp_db_query is in condition statement is should the Error, Query will execute it, don't worry at Error,
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 .
I tested this things,
On 4/11/07, Norman Brandinger norm@goes.com wrote:
Chungyu,
Perhaps the following will work for you:
avp_db_query("DELETE FROM usr_preferences WHERE (username = 'bob') AND (number = '1')");
Using the above as an example, you should be able to INSERT into a table with avp_db_query();
Regards, Norm
chungyu wrote:
Dear all: Avpops module' exported function avp_db_delete() can do delete one
record?
example: I use "test" as default table that has two fields. username | number
bob | 1 alice | 1 bob | 2 my configuration: modparam("avpops", "avp_url", "mysql://ser:heslo@localhost/ser") modparam("avpops", "avp_table", "test") modparam("avpops", "username_column", "username") modparam("avpops", "avp_aliases", "num=i:55") modparam("avpops", "db_scheme", "number_scheme:table=test;value_col=number;value_type=string") if (method=="INVITE"){ avp_db_load("$from/username", "$num/$number_scheme"); //load from table "test" ,number column as string value into AVP name '$num' avp_db_delete("$from/username", "s:test") //delete all bob' record }; if bob calling then bob'record has deleted username | number
alice | 1 But i want delete a record. ex: delete number value is 1 for bob username | number
alice | 1
bob | 2 avp_db_delete() can do delete one record? Another question is avp_db_store() can do insert new data in table? ex: insert into test (username,number) values ("mary","3") username | number
alice | 1
bob | 2
mary | 3 avp_db_store() can do it? sorry,I still can't understand what it mean about avp_db_store() and avp_db_delete(). Can tell me? Thanks a lot in advance Chungyu
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Hello,
On 04/12/07 09:12, raviprakash sunkara wrote:
Norman ,
Avp_db_query also perform the PL/SQL function and Procedure ,
for mysql there are some issues with functions and stored procedures. There is a patch: http://sourceforge.net/tracker/index.php?func=detail&aid=1618322&gro...
It will be reviewed and included for the next release.
Cheers, Daniel
This will support only , MySql version must be grater than 5.0 ,
But if the avp_db_query is in condition statement is should the Error, Query will execute it, don't worry at Error,
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 .
I tested this things,
On 4/11/07, *Norman Brandinger* <norm@goes.com mailto:norm@goes.com> wrote:
Chungyu, Perhaps the following will work for you: avp_db_query("DELETE FROM usr_preferences WHERE (username = 'bob') AND (number = '1')"); Using the above as an example, you should be able to INSERT into a table with avp_db_query(); Regards, Norm chungyu wrote: > Dear all: > Avpops module' exported function avp_db_delete() can do delete one record? > example: > I use "test" as default table that has two fields. > username | number > ------------------- > bob | 1 > alice | 1 > bob | 2 > my configuration: > modparam("avpops", "avp_url", "mysql://ser:heslo@localhost /ser") > modparam("avpops", "avp_table", "test") > modparam("avpops", "username_column", "username") > modparam("avpops", "avp_aliases", "num=i:55") > modparam("avpops", "db_scheme", > "number_scheme:table=test;value_col=number;value_type=string") > if (method=="INVITE"){ > avp_db_load("$from/username", "$num/$number_scheme"); //load from > table "test" ,number column as string value into AVP name '$num' > avp_db_delete("$from/username", "s:test") //delete all bob' record > }; > if bob calling then bob'record has deleted > username | number > -------------------- > alice | 1 > But i want delete a record. > ex: delete number value is 1 for bob > username | number > -------------------- > alice | 1 > --------------------- > bob | 2 > avp_db_delete() can do delete one record? > Another question is avp_db_store() can do insert new data in table? > ex: insert into test (username,number) values ("mary","3") > username | number > ------------------- > alice | 1 > ------------------- > bob | 2 > ------------------- > mary | 3 > avp_db_store() can do it? > sorry,I still can't understand what it mean about avp_db_store() and > avp_db_delete(). > Can tell me? > Thanks a lot in advance > Chungyu > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users@openser.org <mailto:Users@openser.org> > http://openser.org/cgi-bin/mailman/listinfo/users > _______________________________________________ Users mailing list Users@openser.org <mailto:Users@openser.org> http://openser.org/cgi-bin/mailman/listinfo/users <http://openser.org/cgi-bin/mailman/listinfo/users>
-- Thanks and Regards Ravi Prakash Sunkara ravi.sunkara@hyperion-tech.com mailto:ravi.sunkara@hyperion-tech.com M:+91 9985077535 www.hyperion-tech.com http://www.hyperion-tech.com Client and Parent company :- www.august-networks.com
http://www.august-networks.com
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Norman,sunkara,raviprakash sunkara
avp_db_query() can do deleted and stored procedure ex: insert into new data in table avp_write("$ru/username", "$avp(i:55)"); avp_write("$ru/domain", "$avp(i:54)"); avp_db_query("insert into contact (username,domain) values ('$avp(i:55)','$avp(i:54)')")
Callee uri save in contact(table name). Thank you for your help very much
Chungyu
Chungyu,
Perhaps the following will work for you:
avp_db_query("DELETE FROM usr_preferences WHERE (username = 'bob') AND (number = '1')");
Using the above as an example, you should be able to INSERT into a table with avp_db_query();
Regards, Norm
chungyu wrote:
Dear all: Avpops module' exported function avp_db_delete() can do delete one record? example: I use "test" as default table that has two fields. username | number
bob | 1 alice | 1 bob | 2 my configuration: modparam("avpops", "avp_url", "mysql://ser:heslo@localhost/ser") modparam("avpops", "avp_table", "test") modparam("avpops", "username_column", "username") modparam("avpops", "avp_aliases", "num=i:55") modparam("avpops", "db_scheme", "number_scheme:table=test;value_col=number;value_type=string") if (method=="INVITE"){ avp_db_load("$from/username", "$num/$number_scheme"); //load from table "test" ,number column as string value into AVP name '$num' avp_db_delete("$from/username", "s:test") //delete all bob' record }; if bob calling then bob'record has deleted username | number
alice | 1 But i want delete a record. ex: delete number value is 1 for bob username | number
alice | 1
bob | 2 avp_db_delete() can do delete one record? Another question is avp_db_store() can do insert new data in table? ex: insert into test (username,number) values ("mary","3") username | number
alice | 1
bob | 2
mary | 3 avp_db_store() can do it? sorry,I still can't understand what it mean about avp_db_store() and avp_db_delete(). Can tell me? Thanks a lot in advance Chungyu