【问题标题】:SQL Error 1630: Function SUBSTRING does not exist.. huh?SQL 错误 1630:函数 SUBSTRING 不存在.. 嗯?
【发布时间】:2021-10-12 01:06:44
【问题描述】:

没错。所以我在一个恰好使用 SUBSTRING 的 MySQL DB 中创建了一个存储过程。

通过查询运行程序给了我:

SQL 错误 1630:函数 mydatabase.SUBSTRING 不存在

请原谅?

【问题讨论】:

  • 运行时得到什么:SELECT version();?
  • MySQL 版本 5.1.41 - 我在 Windows XP 上使用 XAMPP 运行它。
  • 你能把代码粘贴到你正在使用的地方吗?大概在代码中你实际上并没有在它前面加上 mydatabase.?
  • 这是我的 UDF pastebin.com/nYdYBB7u,这是对同一 pastebin.com/enky52Rf 的查询

标签: mysql stored-procedures


【解决方案1】:

Substring的方法调用后第一个括号前是否有空格?

它出现在第 40 行:

 IF i > 1 AND j > 1 AND (s1_char = SUBSTRING (s2, j - 1, 1))

即确保

select substring(CustomerName, 1, 4) AS CustName from MyTable;

代替:

select substring (CustomerName, 1, 4) AS CustName from MyTable;

【讨论】:

  • 宾果游戏。刚刚测试过,这似乎可以解释它!
  • 天啊,空格敏感!
猜你喜欢
  • 2011-05-09
  • 2016-01-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多