[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: [sqr-users] Is it possible - or advisable - to set a sql committo 1?
Use on-error to execute a paragraph that checks the error code to see
if the error is a duplicate row. The error code is platform specific,
so you'll have to find the code for your database.
If the error is a duplicate, don't do anything in the error paragraph.
If it's not a duplicate error, you probably want to show the error and
terminate.
Note: This won't work if you are using INSERT (...) SELECT FROM....
It only works if you are selecting and then inserting one row at a
time.
begin-sql on-error=check-for-duplicates
INSERT ....
end-sql
begin-procedure check-for-duplicates
if #sql-error <>-9 !this code is platform specific
<put some error code and terminate here>
end-if
end-procedure
On Tue, 6 Apr 2004 12:53:16 -0500, you wrote:
>
>Greetings,
>
>We have an interface that inserts rows of data into PS_JOB.
>
>We have been asked to change the logic so when an insert error occurs, the
>rest of the input file data can be inserted rather than
>have the process stop with the insert error.
>
>I'm thinking the only way to do this is to commit the insert after each row.
>
>1) Can this be done? I am using begin-sql for the insert statement.
>
>2) What are the risks with this approach, besides, large overhead as each row
>is committed?
>
>Thanks,
>
>Joe Johnson
>Programmer Analyst
>ADP ESG - Technical Services Group
>
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users