mysql ÊÂÎñ »Ø¹ö ʧ°Ü
CREATE PROCEDURE `ba3`(id int)
begin
START TRANSACTION;££££££¼ÓÉÏÁË
savepoint sp£»
begin
update ba2 a, (select max(a) as aa from ba2 where a < id) b set a.b=1 where a.a=b.aa;
delete from ba2 where a=id;
end;
if @@error_count=0 then
commit;
else
rollback sp;
end if£»
end;
·¢ÏÖ²»Äܼ°Ê±»Øµ½savepoint sp£»
Çë¿´ÎÒµÄÖ´Ðйý³Ì
mysql> select * from ba2;£££££££££££££Ã»ÓÐ×÷²Ù×÷ǰ ÔʼÊý¾Ý
+------+-----+
| b | a |
+------+-----+
| 1 | 1 |
| 0 | 102 |
| 0 | 103 |
| 0 | 104 |
+------+-----+
4 rows in set (0.00 sec)
mysql> call ba2(103);
ERROR 1054 (42S22): Unknown column 'id22' in 'where clause'
mysql> select * from ba2;££££££££££££Ö´ÐÐÍêºó
+------+-----+
| b | a |
+------+-----+
| 1 | 1 |
| 1 | 102 | ££££££££££££££££££££££°´ÕÕ»á¹ö ²»Òò¸ÃÕâÀïb£½1 Ïà·´Ó¦¸ÃΪ0²Å¶Ô
| 0 | 103 |
| 0 | 104 |
+------+-----+
4 rows in set (0.00 sec)
Õâ¸ö´íÎóÔÚʲôµØ·½ £¬ÈçºÎÐÞ¸ÄÕâ¸ö´æ´¢¹ý³Ì¡££¿£¿ £¨°´ÕÕµÀÀí Ó¦¸ÃÊÂÎñÕûÌå»á¹ö²Å¶Ô £¿£¿£¿£¿£¿£© <
Ïà¹ØÎÊ´ð£º
±àÒëÆ÷£ºC-Free4
mysql µ¥¶À°²×°µÄ£¬ÏÖÔÚΪapache+php+mysql¿ÉÒÔʹÓá£
×î½üÔÚÁ·Ï°c£¬c++£»ÏëÓÃc£¬c++Á¬½ÓÏÂÎÒµÄmysql£¬ºÃ¶àµØ·½¶à˵mysql.hÕÒ²»µ½¡£¶øÇÒÎÒmysqlûÓÐËùνµÄincludeÎļþ¼Ð°¡¡£
Íü¸ßÊÖÖ¸µãÒ»¶ ......
ÎÒµÄMysql ʹÓõÄʱºò ÓÃdos½¨Á¢µÄÊý¾Ý±í ÔÚdosÖÐÄÜÏÔʾ³öÖÐÎÄ
µ«ÊÇÔÚ ÆäËûµÄ¿ÉÊÓÒ³Ãæ ºÍÍøÒ³Öж¼ÏÔʾÂÒÂë ÈçºÎ½â¾ö£¿
ÔÚmysql¿ØÖÆÌ¨:show variables like 'char%';Ìù½á¹û³öÀ´¿´¿´¡£
mysqlÃüÁîÐÐģʽÏÂ: ......
ÏÈÉÏ´íÎó
ÎÞ·¨Áª½ÓÊý¾Ý¿â
java.sql.SQLException: Before start of result set
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.java: ......
ÎÒÒѾ°´Õս̳ÌÉÏÅäÖÃtomcatµÄserver.xml
<Context path = "/POS" docBase = "POS" debug = "5" reloadable = "true" crossContext = "true" workDir = &quo ......
String SQL="insert into ѧÉúÐÅÏ¢±í values(StudentNumber,StudentName,StudentAge)";ÆäÖÐStudentNumber,StudentName,StudentAge¶¼ÊDZäÁ¿¡£ÕâÑùд²»¶Ô¡¡µ½µ×¸Ãզд°¡
Íò·Ö¸Ðл£¡
String SQL=&q ......