mysql Óï¾ä´íÎó - ÆäËûÊý¾Ý¿â¿ª·¢ / MySQL/Postgresql
CREATE PROCEDURE dowhile()
BEGIN
DECLARE v1 INT DEFAULT 5;
WHILE v1 > 0 DO
SET v1 = v1 - 1;
END WHILE;
END
ÎÒÔËÐÐmysql°ïÖúÀïÃæµÄ³ÌÐò»á±¨´í£¬²»ÖªµÀΪʲô£¬ÇëÖªµÀµÄ¸æËßÎÒÒ»ÏÂ
´íÎó´úÂë: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INT DEFAULT 5' at line 3
(ºÄ·Ñ 0 ms)
´íÎó´úÂë: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHILE v1 > 0 DO
SET v1 = v1 - 1' at line 1
(ºÄ·Ñ 0 ms)
´íÎó´úÂë: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END WHILE' at line 1
(ºÄ·Ñ 0 ms)
´íÎó´úÂë: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END' at line 1
(ºÄ·Ñ 0 ms)
ѧϰ¡£¡£¡£
ÎÒÔËÐÐȷʵ±¨´í£¬ÎÒÔÚsqlyogÀïÃæÔËÐеģ¬mysql°æ±¾ÊÇ5.0.22µÄ
ÆäʵÎÒÏëÑ»·µÄд²åÈëÓï¾ä£¬ÖªµÀÔõôдµÄ´ó¸ç£¬Âé·³¸æËßÎÒ°¡
ÎÒÖ´ÐÐ
mysql> delimiter ;
mysql>
mysql> call dowhile;
ûÓз´Ó¦
SQL code:
mysql&
Ïà¹ØÎÊ´ð£º
String SQL="insert into ѧÉúÐÅÏ¢±í values(StudentNumber,StudentName,StudentAge)";ÆäÖÐStudentNumber,StudentName,StudentAge¶¼ÊDZäÁ¿¡£ÕâÑùд²»¶Ô¡¡µ½µ×¸Ãզд°¡
Íò·Ö¸Ðл£¡
String SQL=&q ......
¸÷λÐÖµÜÇë½Ì Ï£¬ÔÚmysqlÖÐÄܲ»ÄÜʵÏÖÕâÑùÒ»¸ö¹¦ÄÜ£¬
Ò»¸ö×Ö¶ÎAÊÇ´¢´æÒ»´ó¶ÎÎÄ×ÖÄÚÈݵģ¬ÊÇÓ¢ÎÄ£¬Äܲ»ÄÜͨ¹ýMYSQLµÄ²éѯ֮ÀàµÄ¹¦ÄÜ£¬À´»ñµÃÕâ¸ö×Ö¶ÎÖÐ ³öÏÖÆµÂÊ×î¸ßµÄÊ®¸öµ¥´Ê£¬²¢½«ÕâÊ®¸öµ¥´Ê×öΪеÄ×ֶδ¢´æ
a ......
ÔõôÑù²éѯÁ¬½Ó2¸ö±íÖ®ºó µÃ³öµÄбí
ÀýÈç A±í£º·¢¼þÈËID Óʼþ±àºÅ ÓʼþÄÚÈÝ ÊÕ¼þÈËID ·¢¼þʱ¼ä
B±í£ºÊÕ¼þÈËID Óʼþ±àºÅ ÊÕ¼þʱ¼ä
Ê×ÏÈ×öA BµÄÁ¬½Ó²éѯ ¼´ Óʼþ±àºÅÏàµÈ
²é³ö£ ......
public void StartCmd(string workingDirectory, string command)
{
Process p = new Process();
p.StartInfo.FileName = @"D:\±¸·Ý\epet.sql";
......
1¡¢ÊDz»ÊÇPHPÖÐÖ»ÄÜʹÓÃmysql_query("update user_aa set money=money2-".$bpanmm." where uid=".$userppp);¸üÐÂÊý¾Ý£¿£¿£¿
2¡¢PHP¸üÐÂmysql_fetch_row($res)Óëmysql_fetch_array($res)ÖеÄÊý¾ ......