Error Code: 1630. FUNCTION rand.string does not exist

修复MySQL存储过程错误

1、错误描述

13:50:13	call new_procedure	Error Code: 1630. FUNCTION rand.string does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual	0.046 sec

2、错误原因

CREATE DEFINER=`root`@`localhost` PROCEDURE `new_procedure`()
BEGIN
  set @a=101;
  while @a<2000 do
  set @b = rand.string(10);
  set @c=1;
  insert into example1 values(@a,@b,@c);
  set @a=@a+1;
  if(@a%2=0)
     then
     set @c=0;
     end if;
  end while;
END
在给@b赋值时,用的是@b = rand.string(10),其实是想写个随机字符串存储过程


3、解决办法

CREATE DEFINER=`root`@`localhost` PROCEDURE `new_procedure`()
BEGIN
  set @a=101;
  while @a<2000 do
  set @b = rand_string(10);
  set @c=1;
  insert into example1 values(@a,@b,@c);
  set @a=@a+1;
  if(@a%2=0)
     then
     set @c=0;
     end if;
  end while;
END


在VS Code中使用MSVC进行调试时出现 “program ... does not exist” 错误,通常是由于程序路径配置不正确或者程序未成功编译导致的。以下是一些可能的解决办法: ### 1. 检查 `launch.json` 配置 确保 `launch.json` 文件中的 `program` 字段指向的可执行文件路径正确。例如: ```json { "version": "0.2.0", "configurations": [ { "name": "Debug with MSVC", "type": "cppvsdbg", "request": "launch", "program": "${workspaceFolder}/your_program.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false } ] } ``` 这里的 `${workspaceFolder}/your_program.exe` 需要替换为你实际生成的可执行文件的路径。 ### 2. 确保程序已成功编译 要保证在调试之前程序已经成功编译生成了可执行文件。可以使用 `tasks.json` 来配置编译任务,示例如下: ```json { "version": "2.0.0", "tasks": [ { "label": "build with MSVC", "type": "shell", "command": "cl.exe", "args": [ "/Zi", "/EHsc", "/Fe:", "your_program.exe", "your_source_file.cpp" ], "group": { "kind": "build", "isDefault": true }, "problemMatcher": "$msCompile" } ] } ``` 这里的 `your_program.exe` 是生成的可执行文件名称,`your_source_file.cpp` 是你的源文件名称,需要根据实际情况进行替换。 ### 3. 检查文件路径和名称 要确保文件路径和名称没有拼写错误,并且路径中不包含特殊字符或者空格。如果路径中有空格,需要用引号将路径括起来。 ### 4. 清理并重新构建项目 有时候,旧的构建文件可能会导致问题。可以尝试清理项目,删除所有生成的文件,然后重新构建项目。 ### 5. 检查环境变量 确保系统的环境变量中已经正确配置了MSVC的路径,这样VS Code才能找到 `cl.exe` 等编译工具。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值