¹ØÓÚMysqlµÄÓαêºÍÁÙʱ±í
SQL code:
create procedure sp_delete_probe
(
p_id int
)
begin
drop table if exists temp_port_ids;
create temporary table temp_port_ids(
port_id int default 0
);
drop table if exists temp_group_ids;
create temporary table temp_group_ids(
group_id int default 0
);
drop table if exists temp_device_ids;
create temporary table temp_device_ids(
device_id int default 0
);
drop table if exists temp_policy_ids;
create temporary table temp_policy_ids(
policy_id int default 0
);
insert into temp_port_ids(port_id) select id from t_ports where probe_id=p_id;
insert into temp_group_ids(group_id) select id from t_devicegroups
where port_id in(select * from temp_port_ids);
insert into temp_device_ids(device_id) select id from t_devices
where port_id in(select * from temp_port_ids);
insert into temp_policy_ids(policy_id) select policy_id from t_devicegroups
where id in(select * from temp_group_ids);
insert into temp_policy_ids(policy_id) select policy_id from t_devices
where id in(select * from temp_device_ids);
delete from t_probes where id=p_id;
delete from t_ports where id in(select * from temp_port_ids);
delete from t_port_ips where port_id in(select * from temp_port_ids);
d
Ïà¹ØÎÊ´ð£º
ÇëÎÊÏÂÄܲ»ÄÜÔÙwindows϶¨ÆÚÇå¿ÕmysqlÒ»¸ö±íÖеÄÈ«²¿Êý¾Ý£¬ÓÃPHPʵÏÖ£¡
лл¸÷λÁË
¾Í±ÈÈçÒ»¸öÐÇÆÚÇå¿ÕÒ»´Î
±ÈÈçÿ¸öÐÇÆÚÁùÁãµãÇå¿ÕÒ»´Î£¡
ллÁË
¼Æ»®ÈÎÎñ...php....sql...truncate....OK
Äã¾ÍÕâ½ÓÔÚҳà ......
ÎÒµÄMysql ʹÓõÄʱºò ÓÃdos½¨Á¢µÄÊý¾Ý±í ÔÚdosÖÐÄÜÏÔʾ³öÖÐÎÄ
µ«ÊÇÔÚ ÆäËûµÄ¿ÉÊÓÒ³Ãæ ºÍÍøÒ³Öж¼ÏÔʾÂÒÂë ÈçºÎ½â¾ö£¿
ÔÚmysql¿ØÖÆÌ¨:show variables like 'char%';Ìù½á¹û³öÀ´¿´¿´¡£
mysqlÃüÁîÐÐģʽÏÂ: ......
ÎÒµÄmysqlÔõôûÓа취дÈëÖÐÎÄÊý¾Ý£¿Ö»ÒªÊÇÊý¾ÝдÈëÊý¾Ý¿âʱ ¾Í»á±ä³ÉÈý¸öÎʺŠ£¿Çë½Ì¸ßÈË£¡£¡
linux? ÔõôдÈëµÄ
ÔÚmysqlÖÐÖ´ÐÐ show variables like 'character%'Ìù½á¹û³öÀ´¡£
ÔÚ°²×°MYSLQʱ½«Êý¾Ý¿âµÄ×Ö· ......
mysqlÊý¾Ý¿âµÄ±àÂë¸ñʽÊÇutf8
ÔÚc++³ÌÐòÖÐʹÓÃC APIÖ±½ÓÁ¬½ÓmysqlÊý¾Ý¿â£¬°ÑÖÐÎı£´æµ½mysqlÊý¾Ý¿âÖУ¬ÖÐÎç±ä³ÉÂÒÂë
ʹÓÃmysqlµÄloadÃüÁîµ¼ÈëÎı¾Îļþ£¬ÎÞÂÛÎı¾ÎļþÊÇANSI»¹ÊÇutf8±àÂ룬¶¼ÊÇÂÒÂë
ÇëÎÊÉÏÃæÁ½¸öÎÊ ......
PHPCMSÆóÒµ»ÆÒ³2008·ÖÒ³ÎÊÌâ
ÎÒÓÃÒÔÏ·½Ê½Ç󯽾ùÊý
{get sql="SELECT DISTINCT c.*,
(select round(avg(sort1)) from `phpcms_yp_dp` where userid=c.userid) avgsort1,
(select round(avg(avgp ......