mysql> delimiter //
mysql> CREATE FUNCTION getParentListmysql 运行里面可以这样写 用phpMyAdmin 应该怎么创建函数呢
  如果运行里面创建好了  我导出 后 的代码
CREATE DEFINER=`root`@`localhost` FUNCTION `getParentList
 在导入 就导入不了 如何解决  我最终是要放到服务器上的。 服务器只提供 phpMyAdmin 

解决方案 »

  1.   

    phpMyAdmin 写函数相同啊。phpMyAdmin 也有自己的导出导入功能。 你可以参考一下phpMyAdmin 的帮助。
      

  2.   

     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 'delimiter //
      

  3.   

    phpMyAdmin 不需要 delimiter //
    它的界面上有个设置 delimtier符号的地方。
      

  4.   

    错误SQL 查询:CREATE FUNCTION `getParentLst` (
    ChildId INT
    ) RETURNS varchar( 1000 ) DETERMINISTIC BEGIN DECLARE sTemp VARCHAR( 1000 ) default '';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 '' at line 5 
    一下是我的创建函数 代码
    CREATE FUNCTION `getParentLst`(ChildId INT)
         RETURNS varchar(1000)
         DETERMINISTIC
         BEGIN
          DECLARE sTemp VARCHAR(1000) default '';
          DECLARE vID INT;
         DECLARE iCnt INT default 0;
        
          set vID = ChildId;
          REPEAT
                 select pid into vID from treenodes where id=vID;
                  if FOUND_ROWS() then
                          set sTemp=concat(sTemp,'\'',vID,'\',');
                          set iCnt=iCnt+1;
                  end if;
          UNTIL not FOUND_ROWS() or iCnt>=10  END REPEAT;
          if length(sTemp)>1 then
                  set sTemp=left(sTemp,length(sTemp)-1);
          end if;
          RETURN sTemp;
         END命令行成功
    phpmyadmin  失败 
      

  5.   

    行哦导入是怎么弄的呢? 
    帮助文档在哪。全是英文?
    生成的funcation   有这个 root localhost
    CREATE DEFINER=`root`@`localhost` FUNCTION `getParentList
        需要修改哪里?