惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Microsoft Azure Blog
Microsoft Azure Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Webroot Blog
Webroot Blog
腾讯CDC
The Last Watchdog
The Last Watchdog
博客园 - 司徒正美
H
Hacker News: Front Page
I
InfoQ
A
Arctic Wolf
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Heimdal Security Blog
L
LINUX DO - 最新话题
T
Threat Research - Cisco Blogs
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
Security Latest
Security Latest
D
DataBreaches.Net
C
Check Point Blog
J
Java Code Geeks
www.infosecurity-magazine.com
www.infosecurity-magazine.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Attack and Defense Labs
Attack and Defense Labs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
L
Lohrmann on Cybersecurity
雷峰网
雷峰网
Vercel News
Vercel News
WordPress大学
WordPress大学
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Spread Privacy
Spread Privacy
Forbes - Security
Forbes - Security
阮一峰的网络日志
阮一峰的网络日志
Hacker News: Ask HN
Hacker News: Ask HN
大猫的无限游戏
大猫的无限游戏
I
Intezer
N
News and Events Feed by Topic
小众软件
小众软件
B
Blog RSS Feed
Help Net Security
Help Net Security
Google DeepMind News
Google DeepMind News
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
美团技术团队
Recent Announcements
Recent Announcements
Martin Fowler
Martin Fowler
Engineering at Meta
Engineering at Meta
The GitHub Blog
The GitHub Blog
MyScale Blog
MyScale Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main

博客园 - niceboy

Redhat Linux 7.3 虚拟机通过USB挂载NTFS格式的移动硬盘 自己写的一个记录日常事务的小软件,也可以作为密码保险箱和提醒工具 访问IIS元数据库失败解决办法 海事卫星通信 关于GPS车载终端的研究 操作或事件已被禁用模式阻止 售前工程师的来世今生(转载自IT售前论坛的经典基础知识)【转】 用Oracle Instant client 打包Oracle客户端 关于FTP端口【转】 轻松掌握使用 SQL Server 浏览器,解决SQL Server 2005跨网段不能连接问题 论《金瓶梅》与项目管理中人际关系协调 软件开发质量管理层次模型 软件开发中项目需求管理简述 软件测试的基本概念和方法 Web应用程序的整体测试 VSS使用手册 .Net 2.0新功能:重构(Refactoring)(4) .Net 2.0新功能:重构(Refactoring)(3) .Net 2.0新功能:重构(Refactoring)(2)
Oracle数据库中 编号自动增长的实现
niceboy · 2009-03-11 · via 博客园 - niceboy

最近做一个项目,又要用Oracle了,其实我对Oracle并没有好感,可能是我用习惯了MS的东西。

其中有个问题 ,就是要在数据表里插入数据的时候实现像SQL Server和Access一个的自增编号,多好的功能啊,Oracle为什么不给实现一下呢,只能自己想办法了。

从网上查到一些资料,简单记录一下,希望对大家有帮助。

首先用正确的用户登录,用SQL语句创建自增长的序列

CREATE SEQUENCE buiding_id_seq
NOCYCLE
MAXVALUE 99999999

START WITH 1;

INCREMENT BY 1

这样就建立一个像sql下的自动编号列。

可是我在插入数据的时候insert into Buiding values(buiding_id_seq.nextval,'测试','测试')

就这么简单,一切OK啦