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&
Ïà¹ØÎÊ´ð£º
ÏÈÉÏ´íÎó
ÎÞ·¨Áª½ÓÊý¾Ý¿â
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: ......
String SQL="insert into ѧÉúÐÅÏ¢±í values(StudentNumber,StudentName,StudentAge)";ÆäÖÐStudentNumber,StudentName,StudentAge¶¼ÊDZäÁ¿¡£ÕâÑùд²»¶Ô¡¡µ½µ×¸Ãզд°¡
Íò·Ö¸Ðл£¡
String SQL=&q ......
CREATE DATABASE ADDRESSLIST;
USE ADDRESSLIST;
DROP TABLE IF EXISTS FRIEND;
CREATE TABLE FRIEND
(FRIEND_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY ,
FRIEND_NAME VARCHAR(20) NOT N ......
ÎÒÏÖÔÚÏëÓÃJSPʵÏÖQQÓÊÏäÀïµÄ¶¨Ê±·¢ËÍ£¬ÎÒÏëͨ¹ýÊý¾Ý¿â½øÐж¨Ê±²åÈëÊý¾Ý¡£
µ«²»ÖªµÀÈçºÎʵÏÖ£¬»òÕß´ó¼ÒÓиüºÃµÄ·½·¨£¬²»Ò»¶¨ËµÊÇÊý¾Ý¿â¡£
Çë´ó¼Ò¸øµãÒâ¼û£¬°ÝлÀ²¡£
quataz¶¨Ê±Æ÷×é¼þÊǸöºÜºÃµÄ½â¾ö·½°¸¡£
È ......
public void StartCmd(string workingDirectory, string command)
{
Process p = new Process();
p.StartInfo.FileName = @"D:\±¸·Ý\epet.sql";
......