ORACLE queries one data table and then inserts two of the other tables by traversing

Source: Internet
Author: User

ORACLE queries one data table and then inserts two of the other tables by traversing

Grammar

The first type:
By using the Oracle statement block

-- Specifies that all departments of the document can view DECLARE cursor table_dept  is< /span> Select Id,uname from  g_users where  Utype=2  and Status>-1  ; Begin  for  C in   Table_dept loop INSERT into G_knowdocright (Rid,dirid,docid,userid) VALUES (Sys_guid (),  "  permission number  "  ,  "  document number  "          ,c.id);      End Loop;      Commit End 

The second:
Implemented using pure SQL statements

Select s_tag_tagid.nextval,widgetid,'15895829126','Nanjing  ' from

ORACLE queries one data table and then inserts two of the other tables by traversing

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.