Minimum length not met: value 0 < 1 minimum length
2021/7/28 6:05:48
本文主要是介绍Minimum length not met: value 0 < 1 minimum length,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
这个问题出现在oracle使用 CPHP 这个函数中;
下面是官方解释:https://cx.rightnow.com/app/answers/detail/a_id/11230/~/min-length-not-met%3A-value-0-%3C-1-minimum-length
Why do I get an error when assigning an empty string to a nullable text field in CPHP code?
Environment:
Connect for PHP (CPHP) API
Resolution:
When using the CPHP API, assignments made to object fields that are defined as nullable can be assigned the value of null, but not an empty string. If an empty string ("") is assigned you will receive an error indicating 'Min length not met: value 0 < 1 minimum length'. Different techniques to avoid assigning an empty string value can be employed in code, including checking for empty string ($var != "") before making assignments, or using default values in functions (function test($var="blank")) where assignments are made.
翻译过来:
为什么在 CPHP 代码中将空字符串分配给可为空的文本字段时出现错误?
环境:
连接 PHP (CPHP) API
解决:
使用 CPHP API 时,对定义为可为空的对象字段所做的分配可以分配 null 值,但不能分配空字符串。如果分配了空字符串 (""),您将收到一条错误消息,指示“未满足最小长度:值 0 < 1 最小长度”。可以在代码中使用不同的技术来避免分配空字符串值,包括在进行分配之前检查空字符串 ($var != ""),或在函数中使用默认值(函数 test($var="blank"))进行分配的地方。
我真是想无力吐槽oracle~,踩过太多的坑了....
这篇关于Minimum length not met: value 0 < 1 minimum length的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-07-02springboot项目无法注册到nacos-icode9专业技术文章分享
- 2024-06-26结对编程到底难不难?答案在这里
- 2024-06-19《2023版Java工程师》课程升级公告
- 2024-06-15matplotlib作图不显示3D图,怎么办?
- 2024-06-1503-Loki 日志监控
- 2024-06-1504-让LLM理解知识 -Prompt
- 2024-06-05做软件测试需要懂代码吗?
- 2024-06-0514-ShardingSphere的分布式主键实现
- 2024-06-03为什么以及如何要进行架构设计权衡?
- 2024-05-31全网首发第二弹!软考2024年5月《软件设计师》真题+解析+答案!(11-20题)