Salesforce 中何时强制执行文本字段长度?我可以得到实际的字段长度吗?
我今天从 Salesforce 导入数据,当时我的 BULK INSERT 因数据太长而失败:比 Salesforce 本身报告的字段长度长。我发现这个字段(Salesforce 描述为 TEXT(40)
)的值最多可达 255 个字符。我只能猜测该字段过去有 255 个字符的限制,已更改为 TEXT(40),并且 Salesforce 尚未应用新的限制。
何时强制执行字段长度?仅当插入或修改新数据时?它们是否在任何其他时间点(例如每周的时间表)执行?
其次,有没有办法知道实际字段长度限制?作为一名数据库人员,无法依赖所提供的元数据让我感到畏缩。作为一个随机示例,如果我们要从备份中恢复该表,我认为长值会爆炸,或者可能被截断。
我正在使用 SOAP API。
I was importing data from Salesforce today, when my BULK INSERT failed with too-long data: longer than the field length as reported from Salesforce itself. I discovered that this field, which Salesforce describes as a TEXT(40)
, has values up to 255 characters long. I can only guess that the field had a 255-character limit in the past, was changed to TEXT(40)
, and Salesforce has not yet applied the new limit.
When are field lengths enforced? Only when new data is inserted or modified? Are they enforced at any other point, such as a weekly schedule?
Second, is there any way to know the actual field length limit? As a database guy, not being able to rely on the metadata I've been given makes me cringe. As just one random example, if we were to restore this table from backup I assume that the long values would bomb, or possibly be truncated.
I'm using the SOAP API.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
字段长度在创建/更新时强制执行。如果您稍后减少长度,现有记录不会被截断。我想这是因为销售人员无论如何都将这些存储为 255。
务实地说,salesforce 中任何文本字段的“实际”字段限制应视为 255。这是因为在过去的某个时刻,可能在限制高达 255 时插入记录。
你是对的如果您要转储该表并重新插入它,您很可能会因为值超出当前定义的字段大小而拒绝记录。
Field lengths are enforced on create/update. If you later reduce the length, existing records are not truncated. I imagine this is because salesforce is storing these as 255's regardless.
Pragmatically speaking, the "actual" field limit for any text field in salesforce should be considered 255. This is because it's possible that at some point in the past, records were inserted when the limit was as high as 255.
And you're right that if you were to dump that table and re-insert it, you very well could have rejected records due to values that exceed the field size as currently defined.