Why does an oracle plsql varchar2 variable need a size but a parameter does not?(为什么oracle plsql varchar2 变量需要大小而参数不需要?)
问题描述
假设你有这个程序:
PROCEDURE f (param VARCHAR2)
IS
var VARCHAR2(10);
BEGIN
var := 'hi';
END f;
我想了解为什么 var
需要指定长度,而 param
不需要.我很难在 oracle 文档中找到相关信息.
I would like to understand why var
needs a length specified, but param
does not. I'm having a hard time finding information about this in the oracle docs.
推荐答案
Oracle 数据库从调用过程的环境中导出参数的长度、精度和小数位数."
"Oracle Database derives the length, precision, and scale of an argument from the environment from which the procedure is called."
请查看此相关问题.
参考:Oracle® 数据库 SQL 参考 10g 第 2 版(10.2)请查看语义/参数/数据类型.
Reference: Oracle® Database SQL Reference 10g Release 2 (10.2) Please look under semantics / argument / datatype.
这篇关于为什么oracle plsql varchar2 变量需要大小而参数不需要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为什么oracle plsql varchar2 变量需要大小而参数不需要?


基础教程推荐
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01