- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- doing random update and etc....
Operating System - HP-UX
1758859
Members
3109
Online
108876
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 01:30 PM
тАО08-01-2002 01:30 PM
currently the script below is doing commit for every row that was being insert..can you help me to come up with something like doing commit
for every 50 ...and also i want to perform
random updates at well...in addition, this loader insert the same data over and over again..i want to change it...too...
create PROCEDURE tester1 IS
numcount number:=0;
begin
while true loop
numcount:=numcount+1;
insert into employee1 values (numcount,'lkjljf','dlkjdeann',87970.80);
commit;
insert into employee2 values (numcount,'lkjljf','dlkjdeann',87970.80);
commit;
insert into employee3 values (numcount,'lkjljf','dlkjdeann',87970.80);
commit;
insert into employee4 values (numcount, 'dkjl','dlakdjfelsdjfe',10000);
commit;
insert into employee5 values (numcount, 'dldffalj','kjhgehoij',6700);
commit;
insert into employee6 values (numcount, 'dlfkajdfoer','ldifjoie',87509);
commit;
insert into employee7 values (numcount, 'opijo9jr','okdfetr',87834);
commit;
insert into employee8 values (numcount, 'p9i-lkdf','eoljedr',8760);
commit;
insert into employee9 values (numcount, 'lkdjfld','dfdflerj',98590);
commit;
insert into employee10 values (numcount, 'aldfkjaoeruljdkf','eiurykhdf',54295);
commit;
end loop;
END;
/
for every 50 ...and also i want to perform
random updates at well...in addition, this loader insert the same data over and over again..i want to change it...too...
create PROCEDURE tester1 IS
numcount number:=0;
begin
while true loop
numcount:=numcount+1;
insert into employee1 values (numcount,'lkjljf','dlkjdeann',87970.80);
commit;
insert into employee2 values (numcount,'lkjljf','dlkjdeann',87970.80);
commit;
insert into employee3 values (numcount,'lkjljf','dlkjdeann',87970.80);
commit;
insert into employee4 values (numcount, 'dkjl','dlakdjfelsdjfe',10000);
commit;
insert into employee5 values (numcount, 'dldffalj','kjhgehoij',6700);
commit;
insert into employee6 values (numcount, 'dlfkajdfoer','ldifjoie',87509);
commit;
insert into employee7 values (numcount, 'opijo9jr','okdfetr',87834);
commit;
insert into employee8 values (numcount, 'p9i-lkdf','eoljedr',8760);
commit;
insert into employee9 values (numcount, 'lkdjfld','dfdflerj',98590);
commit;
insert into employee10 values (numcount, 'aldfkjaoeruljdkf','eiurykhdf',54295);
commit;
end loop;
END;
/
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 05:40 PM
тАО08-01-2002 05:40 PM
Solution
Not sure whether you are using Oracle or not, but from the syntax, it seems that my assumption is right.
You can use the SET AUTOCOMMIT command to help you to issue commit on a preset number of DMLs executed.
SET AUTOCOMMIT ON
Turns autocommit on.
SET AUTOCOMMIT OFF
Turns autocommit off (the default).
SET AUTOCOMMIT n
Commits changes after n SQL DML commands.
SET AUTOCOMMIT IMMEDIATE
Turns autocommit on.
Hope this can help to to solve the problem.
Regards,
Kenneth
You can use the SET AUTOCOMMIT command to help you to issue commit on a preset number of DMLs executed.
SET AUTOCOMMIT ON
Turns autocommit on.
SET AUTOCOMMIT OFF
Turns autocommit off (the default).
SET AUTOCOMMIT n
Commits changes after n SQL DML commands.
SET AUTOCOMMIT IMMEDIATE
Turns autocommit on.
Hope this can help to to solve the problem.
Regards,
Kenneth
Always take care of your dearest before it is too late
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2002 02:13 AM
тАО08-02-2002 02:13 AM
Re: doing random update and etc....
To commit after every 50 iterations through your loop, you can use your numcount variable like this:
if numcount / 50 = floor (rowcount / 50) then
commit;
end if;
Oracle publish a random package on their MetaLink website. Try this URL: http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=1028249.6, or go to MetaLink and search for "random package".
if numcount / 50 = floor (rowcount / 50) then
commit;
end if;
Oracle publish a random package on their MetaLink website. Try this URL: http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=1028249.6, or go to MetaLink and search for "random package".
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP