简体   繁体   English

MySql存储过程编号增量器

[英]MySql Stored Procedure number incrementer

I'm attempting to build an account number generator. 我正在尝试建立一个帐号生成器。 I was thinking I could accomplish this by building a stored procedure for incrementing numbers in a db table followed by returning the value. 我以为我可以通过建立一个存储过程来实现此目的,该存储过程用于在db表中递增数字,然后返回该值。

I'm not a dba, so I do not know very much about setting something like this up. 我不是dba,所以我对设置这样的东西不太了解。 Could someone point me in the right direction in order to accomplish this task. 有人可以指出我正确的方向以完成这项任务。 Thanks. 谢谢。

Yes, an Auto Increment Number column will resolve you problem.. and if your account number is alphanumeric then you can logically concat that incremented number with your string part. 是的,“自动递增编号”列将解决您的问题..如果您的帐号是字母数字,那么您可以在逻辑上将该递增编号与字符串部分连接起来。 And yes, procedure is also an alternate, it will call purely your logic. 是的,过程也是一种替代方法,它将纯粹调用您的逻辑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM