有人还在SQL存储过程中进行复杂的验证吗? [英] Does anyone still do complex validation in SQL stored procedures?

查看:120
本文介绍了有人还在SQL存储过程中进行复杂的验证吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我找到了一种在SQL92兼容的RDBMS中进行简单正则表达式和LL(1)解析的方法,使用存储过程和一些表进行解析和扫描。



这样做的结果是,如果你传递复杂的结构化文本数据 - 从URL到电子邮件的任何东西,比如JSON,你可以得到验证的东西,甚至可以为你规范化数据。



我不想把精力花在任何人不在乎的事情上,而且我多年来一直没有做生意。



这样的东西还有用吗?



我尝试了什么:



我还没有尝试过任何东西。这不是真正的那种问题

So I figured out a way to do simple regex and LL(1) parsing inside a SQL92 compliant RDBMS, using stored procs and a few tables for parsing and scanning.

The upshot of this is if you pass complicated structured textual data - anything from an URL to an email addy, to say, JSON, you can get the thing to validate and perhaps even normalize the data for you.

I don't want to expend the effort on something nobody cares about anymore though, and I've been out of business dev for years.

So is something like that useful still?

What I have tried:

I haven't tried anything yet. This isn't really that kind of question

推荐答案

过程的重点在于将逻辑放在数据库中,并且能够通过一次数据库调用执行复杂的操作。我永远不会这样做,但它归结为你想要逻辑生活的地方。我会拒绝验证,您的代码不需要浪费数据库的时间,并向用户报告他们的输入无效。
The point of procs is putting logic in the DB, and also being able to do complex actions with one DB call. I would never do this, but it comes down to where you want the logic to live. I would say no for validation, your code needs to not waste the time of your DB, and report to the user their input is invalid.


这篇关于有人还在SQL存储过程中进行复杂的验证吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆