Insert a data entry in Oracle and return the id of the data entry.

Source: Internet
Author: User

Insert a data entry in Oracle and return the id of the data entry:

/*
Create or replace procedure worktask_content_Insert
(

Theme varchar2,
Type varchar2,
Status varchar2,
Source varchar2,
Content varchar2,
Slave varchar2,
Progress varchar2,
Conversionschedule varchar2,
Meetingid varchar2,
Scheduleid varchar2,
Scale varchar2,
Liableperson varchar2,
Coadjutant varchar2,
Starttime varchar2,
Endtime varchar2,
Completiondate varchar2,
Beforestarttime varchar2,
Starttype varchar2,
Beforeendtime varchar2,
Endtype varchar2,
Revise varchar2,
Departmentstask varchar2,
Sontask varchar2,
Taskcoding varchar2,
Createid varchar2,
Libdeparid varchar2,
Fathertaskid varchar2,
Maxid out varchar2
)
As
Maxtaskid varchar2 (50 );
Begin

-- Insert data
Insert into worktask_content values (values, theme, type, status, source, content, slave, progress, conversionschedule, meetingid, scheduleid, scale, liableperson, coadjutant, starttime, endtime,
Completiondate, beforestarttime, starttype, beforeendtime, endtype, revise, departmentstask, sontask, taskcoding, createid, libdeparid, fathertaskid );
-- Find the maximum value
Select MAX (taskid) into maxtaskid from worktask_content;

Maxid: = maxtaskid;
-- Modify data
Update worktask_content set fathertaskid = maxtaskid where taskid = maxtaskid;


Commit;

Exception
When others then
Rollback;


End;
*/
/
-- Declare
-- B _id varchar (14 );
-- Begin
-- Worktask_content_Insert ('23', '1', '1', '1', '1', '1', '1', '1', '1', '1 ', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1 ', '1', '1', '1', '1', '1', '1', '1', '1', B _id );
-- Dbms_output.put_line (B _id );
-- End;


-- Select * from worktask_content
/

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.