Setting table fields in an Oracle database is an automatic sequence

Source: Internet
Author: User

--Create a sequenceCreateSequence Zonecode_seq Start with 1Increment by 1; --Create a triggerCreate or Replace TriggerZonecode_trigger beforeInsert  onorg_hospitalzone_dict forEach rowbegin      SelectZonecode_seq.nextval into: New. Hosp_zonecode fromdual; End ; Insert  intoOrg_hospitalzone_dict (Hosp_zonename)Values('1 Hospitals')Insert  intoOrg_hospitalzone_dict (Hosp_zonename)Values('2 Hospitals')Insert  intoOrg_hospitalzone_dict (Hosp_zonename)Values('3 Hospital')Insert  intoOrg_hospitalzone_dict (Hosp_zonename)Values('4 Hospital Area')Select *  fromorg_hospitalzone_dictDelete   fromOrg_hospitalzone_dict TwhereT.hosp_zonecode<5 

Setting table fields in an Oracle database is an automatic sequence

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.